$params['project_change_visa_dataid'], 'directory' => $params['directory'], 'unit_name' => $params['unit_name'], 'time' => $params['time'], 'major' => $params['major'], 'category' => $params['category'], 'review_content' => $params['review_content'], 'review_comments' => $params['review_comments'], 'reviewer' => $params['reviewer'], 'reviewer_id' => $params['reviewer_id'], 'declared_value' => $params['declared_value'], 'calculated_value' => $params['calculated_value'], 'remark' => $params['remark'], ]); 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/23 10:27 */ public static function edit(array $params): bool { Db::startTrans(); try { ProjectChangeVisaContent::where('id', $params['id'])->update([ 'project_change_visa_dataid' => $params['project_change_visa_dataid'], 'directory' => $params['directory'], 'unit_name' => $params['unit_name'], 'time' => $params['time'], 'major' => $params['major'], 'category' => $params['category'], 'review_content' => $params['review_content'], 'review_comments' => $params['review_comments'], 'reviewer' => $params['reviewer'], 'reviewer_id' => $params['reviewer_id'], 'declared_value' => $params['declared_value'], 'calculated_value' => $params['calculated_value'], 'remark' => $params['remark'], ]); 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/23 10:27 */ public static function delete(array $params): bool { return ProjectChangeVisaContent::destroy($params['id']); } /** * @notes 获取详情 * @param $params * @return array * @author likeadmin * @date 2024/02/23 10:27 */ public static function detail($params): array { return ProjectChangeVisaContent::findOrEmpty($params['id'])->toArray(); } }