'ID', 'mall_id' => 'Mall ID', 'last_id' => 'Last ID', 'total_num' => 'Total Num', 'status' => 'Status', 'created_at' => 'Created At', 'updated_at' => 'Updated At', ]; } /** * 保存数据 * * @author ltm * @return bool|Exception */ public static function setData($params) { try { if (empty($params['id'])) { $model = new self(); } else { $model = self::findOne(['id' => $params['id'], 'status' => [StatusEnum::ENABLED, StatusEnum::DISABLED]]); if (empty($model)) throw new \Exception('数据不存在或者已删除'); } if (!$model->load($params, '') || !$model->save()) throw new \Exception($model->getErrorMessage()); return $model->id; } catch (\Exception $e) { self::$static_error = $e->getMessage(); return false; } } }