正在显示
3 个修改的文件
包含
8 行增加
和
6 行删除
| @@ -104,6 +104,7 @@ class ProjectLogic extends BaseLogic | @@ -104,6 +104,7 @@ class ProjectLogic extends BaseLogic | ||
| 104 | * @time :2023/8/30 12:14 | 104 | * @time :2023/8/30 12:14 |
| 105 | */ | 105 | */ |
| 106 | public function saveProject($param){ | 106 | public function saveProject($param){ |
| 107 | + | ||
| 107 | //未续费项目 | 108 | //未续费项目 |
| 108 | if($param['type'] == Project::TYPE_FIVE){ | 109 | if($param['type'] == Project::TYPE_FIVE){ |
| 109 | $param['extend_type'] == Project::TYPE_FIVE; | 110 | $param['extend_type'] == Project::TYPE_FIVE; |
| @@ -127,7 +128,8 @@ class ProjectLogic extends BaseLogic | @@ -127,7 +128,8 @@ class ProjectLogic extends BaseLogic | ||
| 127 | } | 128 | } |
| 128 | $param['confirm_file'] = Arr::a2s($param['confirm_file']); | 129 | $param['confirm_file'] = Arr::a2s($param['confirm_file']); |
| 129 | } | 130 | } |
| 130 | - $this->model->edit($param,['id'=>$param['id']]); | 131 | + $filteredData = array_only($param, $this->model->fillable); |
| 132 | + $this->model->edit($filteredData,['id'=>$param['id']]); | ||
| 131 | Common::del_user_cache($this->model->getTable(),$param['id']); | 133 | Common::del_user_cache($this->model->getTable(),$param['id']); |
| 132 | return $this->success(); | 134 | return $this->success(); |
| 133 | } | 135 | } |
| @@ -92,8 +92,7 @@ class Base extends Model | @@ -92,8 +92,7 @@ class Base extends Model | ||
| 92 | public function add($data){ | 92 | public function add($data){ |
| 93 | $data['created_at'] = date('Y-m-d H:i:s'); | 93 | $data['created_at'] = date('Y-m-d H:i:s'); |
| 94 | $data['updated_at'] = $data['created_at']; | 94 | $data['updated_at'] = $data['created_at']; |
| 95 | - $filLabelData = Arr::only($data, $this->getFillable()); | ||
| 96 | - return $this->insert($filLabelData); | 95 | + return $this->insert($data); |
| 97 | } | 96 | } |
| 98 | 97 | ||
| 99 | /** | 98 | /** |
| @@ -122,8 +121,6 @@ class Base extends Model | @@ -122,8 +121,6 @@ class Base extends Model | ||
| 122 | } | 121 | } |
| 123 | $query = $this->formatQuery($condition); | 122 | $query = $this->formatQuery($condition); |
| 124 | $data['updated_at'] = date('Y-m-d H:i:s'); | 123 | $data['updated_at'] = date('Y-m-d H:i:s'); |
| 125 | -// $filLabelData = Arr::only($data, $this->getFillable()); | ||
| 126 | -// file_put_contents(storage_path('logs/lyh_error.log'), var_export($filLabelData, true) . PHP_EOL, FILE_APPEND); | ||
| 127 | return $query->update($data); | 124 | return $query->update($data); |
| 128 | 125 | ||
| 129 | } | 126 | } |
| @@ -13,7 +13,10 @@ class Project extends Base | @@ -13,7 +13,10 @@ class Project extends Base | ||
| 13 | { | 13 | { |
| 14 | //设置关联表名 | 14 | //设置关联表名 |
| 15 | protected $table = 'gl_project'; | 15 | protected $table = 'gl_project'; |
| 16 | - | 16 | + protected $fillable = ['title', 'level','company','lead_name', |
| 17 | + 'mobile','qq','province_id','city_id','version_id','serve_id','mysql_id', | ||
| 18 | + 'cooperate_date','requirement','channel','notice_file','confirm_file','created_at', | ||
| 19 | + 'updated_at','project_location','type','extend_type','status']; | ||
| 17 | const DATABASE_NAME_FIX = 'gl_data_'; | 20 | const DATABASE_NAME_FIX = 'gl_data_'; |
| 18 | 21 | ||
| 19 | const STATUS_ONE = 1;//审核通过 | 22 | const STATUS_ONE = 1;//审核通过 |
-
请 注册 或 登录 后发表评论