generate_sn(ApplyWithSeal::class, 'dataid'), 'num' => generate_sn(ApplyWithSeal::class, 'num'), 'types' => $params['types'], 'filetype' => $params['filetype'], 'ridingseam' => $params['ridingseam'], 'name' => $params['name'], 'frequency' => $params['frequency'], 'limit' => $params['limit'], 'depar' => $params['depar'], 'stampman' => $params['stampman'], 'project' => $params['project'], 'principal' => $params['principal'], 'content' => $params['content'], 'loan' => $params['loan'], 'borrow' => $params['borrow'], 'returndate' => $params['returndate'], 'applicant' => $params['applicant'], 'date' => $params['date'], 'sjborrow' => $params['sjborrow'], 'sjborrower' => $params['sjborrower'], 'sjreturn' => $params['sjreturn'], 'returnee' => $params['returnee'], 'annex' => json_encode($params['annex']), ]); 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 15:05 */ public static function edit(array $params): bool { Db::startTrans(); try { ApplyWithSeal::where('id', $params['id'])->update([ 'types' => $params['types'], 'filetype' => $params['filetype'], 'ridingseam' => $params['ridingseam'], 'name' => $params['name'], 'frequency' => $params['frequency'], 'limit' => $params['limit'], 'depar' => $params['depar'], 'stampman' => $params['stampman'], 'project' => $params['project'], 'principal' => $params['principal'], 'content' => $params['content'], 'loan' => $params['loan'], 'borrow' => $params['borrow'], 'returndate' => $params['returndate'], 'applicant' => $params['applicant'], 'date' => $params['date'], 'sjborrow' => $params['sjborrow'], 'sjborrower' => $params['sjborrower'], 'sjreturn' => $params['sjreturn'], 'returnee' => $params['returnee'], 'annex' => json_encode($params['annex']) ]); 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 15:05 */ public static function delete(array $params): bool { return ApplyWithSeal::destroy($params['id']); } /** * @notes 获取详情 * @param $params * @return array * @author likeadmin * @date 2024/02/23 15:05 */ public static function detail($params): array { $data = ApplyWithSeal::findOrEmpty($params['id'])->toArray(); $data['annex'] = json_decode($params['annex'], true); return $data; } }