'ID', 'mall_id' => 'Mall ID', 'hi_bei' => 'Hi Bei', 'hi_value' => 'Hi Value', 'status' => 'Status', 'created_at' => 'Created At', 'updated_at' => 'Updated At', ]; } /** * 保存数据 * @Author: zmz * @DateTime: 2022/11/16 12:13 * @Copyright: copyright (c) 2022 广东七件事集团 * @param array $params * @return bool */ public static function setData(array $params){ try{ if(isset($params['id']) && $params['id']) { $model = self::findOne(['id' => $params['id']]); if (empty($model)) throw new \Exception('服务不存在或已删除'); }else{ $model = new self(); $model->loadDefaultValues(); } if(!$model->load($params,'') || !$model->save()){ throw new \Exception($model->getErrorMessage()); } return $model; }catch(\Exception $e){ self::setStaticError($e->getMessage()); return false; } } }