This commit is contained in:
weiz 2024-04-22 16:06:31 +08:00
parent cdbc08e784
commit 97097d8f88
4 changed files with 242 additions and 222 deletions

View File

@ -18,6 +18,7 @@
use app\adminapi\lists\BaseAdminDataLists; use app\adminapi\lists\BaseAdminDataLists;
use app\common\lists\ListsExcelInterface; use app\common\lists\ListsExcelInterface;
use app\common\lists\ListsSearchInterface; use app\common\lists\ListsSearchInterface;
use app\common\model\auth\Admin;
use app\common\model\project_process_management\ApplyWithSeal; use app\common\model\project_process_management\ApplyWithSeal;
@ -59,7 +60,13 @@
return ApplyWithSeal::with(['projectInfo', 'dept'])->where($this->searchWhere) return ApplyWithSeal::with(['projectInfo', 'dept'])->where($this->searchWhere)
->limit($this->limitOffset, $this->limitLength) ->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc']) ->order(['id' => 'desc'])
->select() ->select()->each(function ($data) {
$admin = Admin::where('id', 'in', [$data['stampman'], $data['applicant'], $data['sjborrower'], $data['returnee']])->column('name', 'id');
$data['stampman_name'] = $admin[$data['stampman']] ?? '';
$data['applicant_name'] = $admin[$data['applicant']] ?? '';
$data['sjborrower_name'] = $admin[$data['sjborrower']] ?? '';
$data['returnee_name'] = $admin[$data['returnee']] ?? '';
})
->toArray(); ->toArray();
} }

View File

@ -12,22 +12,23 @@
// | 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\lists\ListsExcelInterface; use app\common\lists\ListsExcelInterface;
use app\common\model\project_process_management\JianliProjectProgressReport; use app\common\lists\ListsSearchInterface;
use app\common\lists\ListsSearchInterface; use app\common\model\auth\Admin;
use app\common\model\project_process_management\JianliProjectProgressReport;
/** /**
* JianliProjectProgressReport列表 * JianliProjectProgressReport列表
* Class JianliProjectProgressReportLists * Class JianliProjectProgressReportLists
* @package app\adminapi\listsproject_process_management * @package app\adminapi\listsproject_process_management
*/ */
class JianliProjectProgressReportLists extends BaseAdminDataLists implements ListsSearchInterface,ListsExcelInterface class JianliProjectProgressReportLists extends BaseAdminDataLists implements ListsSearchInterface, ListsExcelInterface
{ {
/** /**
@ -40,7 +41,7 @@ class JianliProjectProgressReportLists extends BaseAdminDataLists implements Lis
{ {
return [ return [
'=' => ['project_id'], '=' => ['project_id'],
'%like%' => ['num','wt_unit','djr'] '%like%' => ['num', 'wt_unit', 'djr']
]; ];
} }
@ -59,7 +60,10 @@ class JianliProjectProgressReportLists extends BaseAdminDataLists implements Lis
return JianliProjectProgressReport::with(['projectInfo'])->where($this->searchWhere) return JianliProjectProgressReport::with(['projectInfo'])->where($this->searchWhere)
->limit($this->limitOffset, $this->limitLength) ->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc']) ->order(['id' => 'desc'])
->select() ->select()->each(function ($data) {
$djr = Admin::field('name')->where('id', $data['djr'])->findOrEmpty();
$data['djr_name'] = $djr?->name;
})
->toArray(); ->toArray();
} }
@ -107,4 +111,4 @@ class JianliProjectProgressReportLists extends BaseAdminDataLists implements Lis
]; ];
} }
} }

View File

@ -16,6 +16,7 @@
use app\common\logic\BaseLogic; use app\common\logic\BaseLogic;
use app\common\model\auth\Admin;
use app\common\model\dept\Dept; use app\common\model\dept\Dept;
use app\common\model\project_process_management\ApplyWithSeal; use app\common\model\project_process_management\ApplyWithSeal;
use think\facade\Db; use think\facade\Db;
@ -146,6 +147,11 @@
{ {
$data = ApplyWithSeal::with(['projectInfo'])->findOrEmpty($params['id']); $data = ApplyWithSeal::with(['projectInfo'])->findOrEmpty($params['id']);
$dept = Dept::field('name')->where('id', $data['depar'])->findOrEmpty(); $dept = Dept::field('name')->where('id', $data['depar'])->findOrEmpty();
$admin = Admin::where('id', 'in', [$data['stampman'], $data['applicant'], $data['sjborrower'], $data['returnee']])->column('name', 'id');
$data['stampman_name'] = $admin[$data['stampman']] ?? '';
$data['applicant_name'] = $admin[$data['applicant']] ?? '';
$data['sjborrower_name'] = $admin[$data['sjborrower']] ?? '';
$data['returnee_name'] = $admin[$data['returnee']] ?? '';
$data['dept_name'] = $dept['name']; $data['dept_name'] = $dept['name'];
$data['types_text'] = $data->types_text; $data['types_text'] = $data->types_text;
$data['ridingseam_text'] = $data->ridingseam_text; $data['ridingseam_text'] = $data->ridingseam_text;

View File

@ -12,21 +12,22 @@
// | author: likeadminTeam // | author: likeadminTeam
// +---------------------------------------------------------------------- // +----------------------------------------------------------------------
namespace app\adminapi\logic\project_process_management; namespace app\adminapi\logic\project_process_management;
use app\common\model\project_process_management\JianliProjectProgressReport; use app\common\logic\BaseLogic;
use app\common\logic\BaseLogic; use app\common\model\auth\Admin;
use think\facade\Db; use app\common\model\project_process_management\JianliProjectProgressReport;
use think\facade\Db;
/** /**
* JianliProjectProgressReport逻辑 * JianliProjectProgressReport逻辑
* Class JianliProjectProgressReportLogic * Class JianliProjectProgressReportLogic
* @package app\adminapi\logic\project_process_management * @package app\adminapi\logic\project_process_management
*/ */
class JianliProjectProgressReportLogic extends BaseLogic class JianliProjectProgressReportLogic extends BaseLogic
{ {
/** /**
@ -131,7 +132,9 @@ class JianliProjectProgressReportLogic extends BaseLogic
*/ */
public static function detail($params): array public static function detail($params): array
{ {
$data = JianliProjectProgressReport::with(['projectInfo'])->findOrEmpty($params['id'])->toArray(); $data = JianliProjectProgressReport::with(['projectInfo'])->findOrEmpty($params['id']);
return $data; $djr = Admin::field('name')->where('id', $data['djr'])->findOrEmpty();
$data['djr_name'] = $djr?->name;
return $data->toArray();
}
} }
}