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

@ -1,77 +1,77 @@
<?php <?php
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | likeadmin快速开发前后端分离管理后台PHP版 // | likeadmin快速开发前后端分离管理后台PHP版
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力 // | 欢迎阅读学习系统程序代码,建议反馈是我们前进的动力
// | 开源版本可自由商用可去除界面版权logo // | 开源版本可自由商用可去除界面版权logo
// | gitee下载https://gitee.com/likeshop_gitee/likeadmin // | gitee下载https://gitee.com/likeshop_gitee/likeadmin
// | github下载https://github.com/likeshop-github/likeadmin // | github下载https://github.com/likeshop-github/likeadmin
// | 访问官网https://www.likeadmin.cn // | 访问官网https://www.likeadmin.cn
// | likeadmin团队 版权所有 拥有最终解释权 // | likeadmin团队 版权所有 拥有最终解释权
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
// | author: likeadminTeam // | author: likeadminTeam
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
namespace app\adminapi\lists\project_process_management; namespace app\adminapi\lists\project_process_management;
use app\adminapi\lists\BaseAdminDataLists; use app\adminapi\lists\BaseAdminDataLists;
use app\common\model\project_process_management\ApplyWithSeal; use app\common\model\project_process_management\ApplyWithSeal;
use app\common\lists\ListsSearchInterface; use app\common\lists\ListsSearchInterface;
/** /**
* ApplyWithSeal列表 * ApplyWithSeal列表
* Class ApplyWithSealLists * Class ApplyWithSealLists
* @package app\adminapi\listsproject_process_management * @package app\adminapi\listsproject_process_management
*/ */
class ApplyWithSealLists extends BaseAdminDataLists implements ListsSearchInterface class ApplyWithSealLists extends BaseAdminDataLists implements ListsSearchInterface
{ {
/** /**
* @notes 设置搜索条件 * @notes 设置搜索条件
* @return \string[][] * @return \string[][]
* @author likeadmin * @author likeadmin
* @date 2024/02/23 15:05 * @date 2024/02/23 15:05
*/ */
public function setSearch(): array public function setSearch(): array
{ {
return [ return [
'=' => ['num'], '=' => ['num'],
];
} ];
}
/**
* @notes 获取列表 /**
* @return array * @notes 获取列表
* @throws \think\db\exception\DataNotFoundException * @return array
* @throws \think\db\exception\DbException * @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException * @throws \think\db\exception\DbException
* @author likeadmin * @throws \think\db\exception\ModelNotFoundException
* @date 2024/02/23 15:05 * @author likeadmin
*/ * @date 2024/02/23 15:05
public function lists(): array */
{ 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']) return ApplyWithSeal::where($this->searchWhere)
->limit($this->limitOffset, $this->limitLength) ->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc']) ->order(['id' => 'desc'])
->select() ->select()
->toArray(); ->toArray();
} }
/** /**
* @notes 获取数量 * @notes 获取数量
* @return int * @return int
* @author likeadmin * @author likeadmin
* @date 2024/02/23 15:05 * @date 2024/02/23 15:05
*/ */
public function count(): int public function count(): int
{ {
return ApplyWithSeal::where($this->searchWhere)->count(); return ApplyWithSeal::where($this->searchWhere)->count();
} }
} }

View File

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