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

@ -17,8 +17,9 @@ 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;
/** /**
@ -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();
} }

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

@ -15,8 +15,9 @@
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 app\common\model\project_process_management\JianliProjectProgressReport;
use think\facade\Db; use think\facade\Db;
@ -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();
} }
} }