'ID', 'mall_id' => '商城ID', 'is_export' => '是否开启一键导入功能:0:否;1是', 'agree_on' => '是否开启协议:0:否;1是', 'status' => '状态[-1:删除;0:禁用;1启用]', 'created_at' => 'Created At', 'updated_at' => 'Updated At', ]; } /** * @method setData * desc * @author zqh * @datetime 2022-05-31T14:41:23+0800 */ public static function setData($params) { $where['mall_id'] = $params['mall_id']; $where['status'] = StatusEnum::ENABLED; # 判断当前标题是否已经存在 $find = self::findOne($where,true); if($find){ $find->updated_at = time(); $find->is_export = $params['is_export']; $find->agree_on = $params['agree_on']; $s = $find->save(); }else { $tplModel = new self(); $tplModel->loadDefaultValues(); $tplModel->mall_id = $params['mall_id']; $create['mall_id'] = $params['mall_id'];# 商城id $create['is_export'] = $params['is_export']; $create['agree_on'] = $params['agree_on']; $create['updated_at'] = time(); if(!$tplModel->load($create,'') || !$tplModel->save()){ self::$static_error = $tplModel->getErrorMessage(); return false; } } return true; } }