$data['name'], 'code' => $data['code'], 'start_logid' => $data['start_logid'], 'end_logid' => $data['end_logid'], 'admin_id' => $data['admin_id'], 'insert_time' => time(), ]; $ExecuteLog_id = $this->insertGetId($insert_data); return $ExecuteLog_id; } /** * 写入数据 * @author 唐远望 * @version 1.0 * @date 2025-12-09 * @param $data * @return bool */ public function addExecuteLog($data) { DB::beginTransaction(); try { $this->addExecuteLog_content($data); DB::commit(); return true; // 成功处理... } catch (\Exception $e) { DB::rollBack(); // 错误处理... return false; } } /** * 编辑内容 * @author 唐远望 * @version 1.0 * @date 2025-12-09 * @param $data * @return bool */ public function editExecuteLog_content($where, $data) { $ExecuteLog = $this->where($where)->first(); if (!$ExecuteLog) { return false; } $ExecuteLog->name = $data['name']; $ExecuteLog->code = $data['responsible_person']; $ExecuteLog->start_logid = $data['platform']; $ExecuteLog->end_logid = $data['company_name']; $ExecuteLog->admin_id = $data['product_name']; $ExecuteLog->update_time = time(); $ExecuteLog->save(); return true; } /** * 更新数据 * @author 唐远望 * @version 1.0 * @date 2025-12-09 * @param $data * @return bool */ public function updateExecuteLog($where, $data) { DB::beginTransaction(); try { $this->editExecuteLog_content($where, $data); DB::commit(); return true; // 成功处理... } catch (\Exception $e) { DB::rollBack(); // 错误处理... return false; } } /** * 修改状态 * @author 唐远望 * @version 1.0 * @date 2025-12-09 * @param $id * @param $status * @return bool */ public function changeStatus($where, $status) { $ExecuteLog = $this->where($where)->first(); if (!$ExecuteLog) { return false; } $ExecuteLog->status = $status; $ExecuteLog->update_time = time(); $ExecuteLog->save(); return true; } /** * 删除数据 * @author 唐远望 * @version 1.0 * @date 2025-12-09 * @param $id * @return bool */ public function deleteExecuteLog($where) { $ExecuteLog = $this->where($where)->first(); if (!$ExecuteLog) { return false; } $ExecuteLog->delete(); return true; } }