$params['side_station_id'], 'problem_cate' => $params['problem_cate'], 'problem_description' => $params['problem_description'], 'problem_name' => $params['problem_name'] ]); 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/02/27 13:58 */ public static function edit(array $params): bool { Db::startTrans(); try { SupervisionSideStationProblem::where('id', $params['id'])->update([ 'side_station_id' => $params['side_station_id'], 'problem_cate' => $params['problem_cate'], 'problem_description' => $params['problem_description'], 'problem_name' => $params['problem_name'], 'update_time' => time(), ]); 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/02/27 13:58 */ public static function delete(array $params): bool { return SupervisionSideStationProblem::destroy($params['id']); } /** * @notes 获取工程监理--旁站问题详情 * @param $params * @return array * @author likeadmin * @date 2024/02/27 13:58 */ public static function detail($params): array { return SupervisionSideStationProblem::withoutField('create_time,update_time,delete_time')->findOrEmpty($params['id'])->toArray(); } }