$params['maintain_exp_type'], 'other_exp_type' => $params['other_exp_type'], 'city' => $params['city'], 'vehicle_type' => $params['vehicle_type'], 'name' => $params['name'], 'age' => $params['age'], 'mobile' => $params['mobile'], 'status' => $params['status'], ]); Db::commit(); return true; } catch (\Exception $e) { Db::rollback(); self::setError($e->getMessage()); return false; } } /** * @notes 编辑 * @param array $params * @return bool * @author likeadmin * @date 2024/07/09 19:45 */ public static function edit(array $params): bool { Db::startTrans(); try { MasterWorkerRegister::where('id', $params['id'])->update([ 'maintain_exp_type' => $params['maintain_exp_type'], 'other_exp_type' => $params['other_exp_type'], 'city' => $params['city'], 'vehicle_type' => $params['vehicle_type'], 'name' => $params['name'], 'age' => $params['age'], 'mobile' => $params['mobile'], 'status' => $params['status'], ]); Db::commit(); return true; } catch (\Exception $e) { Db::rollback(); self::setError($e->getMessage()); return false; } } /** * @notes 删除 * @param array $params * @return bool * @author likeadmin * @date 2024/07/09 19:45 */ public static function delete(array $params): bool { return MasterWorkerRegister::destroy($params['id']); } /** * @notes 获取详情 * @param $params * @return array * @author likeadmin * @date 2024/07/09 19:45 */ public static function detail($params): array { return MasterWorkerRegister::findOrEmpty($params['id'])->toArray(); } }