$params['notice_id'], 'problem_description' => $params['problem_description'], 'content_description' => $params['content_description'], 'demand_description' => $params['demand_description'], ]); 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/03/01 09:20 */ public static function edit(array $params): bool { Db::startTrans(); try { SupervisionNoticeProblem::where('id', $params['id'])->update([ 'notice_id' => $params['notice_id'], 'problem_description' => $params['problem_description'], 'content_description' => $params['content_description'], 'demand_description' => $params['demand_description'], '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/03/01 09:20 */ public static function delete(array $params): bool { return SupervisionNoticeProblem::destroy($params['id']); } /** * @notes 获取工程监理--监理通知问题详情 * @param $params * @return array * @author likeadmin * @date 2024/03/01 09:20 */ public static function detail($params): array { $data = SupervisionNoticeProblem::withoutField('create_time,update_time,delete_time')->findOrEmpty($params['id']); $notice = SupervisionNotice::field('code')->where('id',$data['notice_id'])->findOrEmpty(); $data['code'] = $notice['code']; return $data->toArray(); } }