'integer', 'end_time' => 'timestamp', ]; public function addLog($name="任务名称",$total_num=0) { try { $Log = [ 'name' => $name, 'total_num' => $total_num, 'create_time' => time(), 'update_time' => time(), ]; $logId = $this->insertGetId($Log); return $logId; } catch (\Throwable $th) { //throw $th; } } public function editLog($source_log_id,$total_num,$edit_name,$fail_dec='',$type=0) { try { $data = []; $data['total_num'] = $total_num; if(!empty($fail_dec)){ $data['fail_dec'] = $fail_dec; } $data['update_time'] = time(); if($type==3){ $this->where('source_log_id', $source_log_id) ->update(['end_time' => time()]); }else{ if($type==1){ $data['end_time'] = time(); } $this->where('source_log_id', $source_log_id) ->inc($edit_name) ->update($data); } } catch (\Throwable $th) { //throw $th; } } }