This commit is contained in:
chenbo 2024-02-28 11:21:23 +08:00
parent 4a94919d54
commit 1aecc6692f
2 changed files with 83 additions and 83 deletions

View File

@ -39,6 +39,7 @@ class ApplyWithSealLists extends BaseAdminDataLists implements ListsSearchInterf
{
return [
'=' => ['num'],
];
}
@ -55,7 +56,6 @@ class ApplyWithSealLists extends BaseAdminDataLists implements ListsSearchInterf
public function lists(): array
{
return ApplyWithSeal::where($this->searchWhere)
->field(['id', 'dataid', 'num', 'types', 'filetype', 'ridingseam', 'name', 'frequency', 'limit', 'depar', 'stampman', 'project', 'principal', 'content', 'loan', 'borrow', 'returndate', 'applicant', 'date', 'sjborrow', 'sjborrower', 'sjreturn', 'returnee', 'annex'])
->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc'])
->select()

View File

@ -41,8 +41,8 @@ class ApplyWithSealLogic extends BaseLogic
Db::startTrans();
try {
ApplyWithSeal::create([
'dataid' => $params['dataid'],
'num' => $params['num'],
'dataid' => generate_sn(ApplyWithSeal::class, 'dataid'),
'num' => generate_sn(ApplyWithSeal::class, 'num'),
'types' => $params['types'],
'filetype' => $params['filetype'],
'ridingseam' => $params['ridingseam'],
@ -63,7 +63,7 @@ class ApplyWithSealLogic extends BaseLogic
'sjborrower' => $params['sjborrower'],
'sjreturn' => $params['sjreturn'],
'returnee' => $params['returnee'],
'annex' => $params['annex'],
'annex' => json_encode($params['annex']),
]);
Db::commit();
@ -88,8 +88,6 @@ class ApplyWithSealLogic extends BaseLogic
Db::startTrans();
try {
ApplyWithSeal::where('id', $params['id'])->update([
'dataid' => $params['dataid'],
'num' => $params['num'],
'types' => $params['types'],
'filetype' => $params['filetype'],
'ridingseam' => $params['ridingseam'],
@ -110,7 +108,7 @@ class ApplyWithSealLogic extends BaseLogic
'sjborrower' => $params['sjborrower'],
'sjreturn' => $params['sjreturn'],
'returnee' => $params['returnee'],
'annex' => $params['annex'],
'annex' => json_encode($params['annex'])
]);
Db::commit();
@ -145,6 +143,8 @@ class ApplyWithSealLogic extends BaseLogic
*/
public static function detail($params): array
{
return ApplyWithSeal::findOrEmpty($params['id'])->toArray();
$data = ApplyWithSeal::findOrEmpty($params['id'])->toArray();
$data['annex'] = json_decode($params['annex'], true);
return $data;
}
}