作者 lyh

gx

... ... @@ -104,6 +104,7 @@ class ProjectLogic extends BaseLogic
* @time :2023/8/30 12:14
*/
public function saveProject($param){
//未续费项目
if($param['type'] == Project::TYPE_FIVE){
$param['extend_type'] == Project::TYPE_FIVE;
... ... @@ -127,7 +128,8 @@ class ProjectLogic extends BaseLogic
}
$param['confirm_file'] = Arr::a2s($param['confirm_file']);
}
$this->model->edit($param,['id'=>$param['id']]);
$filteredData = array_only($param, $this->model->fillable);
$this->model->edit($filteredData,['id'=>$param['id']]);
Common::del_user_cache($this->model->getTable(),$param['id']);
return $this->success();
}
... ...
... ... @@ -92,8 +92,7 @@ class Base extends Model
public function add($data){
$data['created_at'] = date('Y-m-d H:i:s');
$data['updated_at'] = $data['created_at'];
$filLabelData = Arr::only($data, $this->getFillable());
return $this->insert($filLabelData);
return $this->insert($data);
}
/**
... ... @@ -122,8 +121,6 @@ class Base extends Model
}
$query = $this->formatQuery($condition);
$data['updated_at'] = date('Y-m-d H:i:s');
// $filLabelData = Arr::only($data, $this->getFillable());
// file_put_contents(storage_path('logs/lyh_error.log'), var_export($filLabelData, true) . PHP_EOL, FILE_APPEND);
return $query->update($data);
}
... ...
... ... @@ -13,7 +13,10 @@ class Project extends Base
{
//设置关联表名
protected $table = 'gl_project';
protected $fillable = ['title', 'level','company','lead_name',
'mobile','qq','province_id','city_id','version_id','serve_id','mysql_id',
'cooperate_date','requirement','channel','notice_file','confirm_file','created_at',
'updated_at','project_location','type','extend_type','status'];
const DATABASE_NAME_FIX = 'gl_data_';
const STATUS_ONE = 1;//审核通过
... ...