'int',// 'bugNo' =>'varchar',//编号 'deal_name' =>'varchar',//处理人 'deal_id' =>'int',//处理人id 'action_name' =>'varchar',//操作人 'action_id' =>'int',//操作人id 'level' =>'int',//优先级 'type' =>'varchar',//问题类型 'status' =>'int',//处理状态 'is_del' =>'int',//是否删除 'addtime' =>'datetime',// 'updatetime' =>'datetime',// ]; protected $updateTime='updatetime'; protected $createTime='addtime'; public static function onAfterWrite($model){ $dealLog = new noteLog(); $origin = $model->getOrigin(); $add=$model->getChangedData(); if(empty($add)){ $dealLog->save([ 'bugNo' =>$model->bugNo,//编号 'type' =>2,//操作类型 'action_uid' =>$model->action_id,//操作人id 'action_name' =>$model->action_name,//操作人名称 'handle_name' =>"deal_name",//操作字段 'action_item' =>"",//操作前值 'action_after' =>$origin['deal_name'], ]); }else{ if(isset($add['deal_name'])){ $dealLog->save( [ 'bugNo' =>$model->bugNo,//编号 'type' =>2,//操作类型 'action_uid' =>$model->action_id,//操作人id 'action_name' =>$model->action_name,//操作人名称 'handle_name' =>'deal_name',//操作字段 'action_item' =>$origin['deal_name'],//操作前值 'action_after' =>$add['deal_name'], ]); } } } }