This commit is contained in:
weiz 2024-03-18 13:48:18 +08:00
parent 24576688bb
commit c648cb667f
2 changed files with 8 additions and 1 deletions

View File

@ -17,6 +17,7 @@ namespace app\adminapi\lists\project_process_management;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\lists\ListsExcelInterface;
use app\common\model\cost_project\CostApprovedProject;
use app\common\model\project_process_management\ApplyWithSeal;
use app\common\lists\ListsSearchInterface;
@ -59,7 +60,10 @@ class ApplyWithSealLists extends BaseAdminDataLists implements ListsSearchInterf
return ApplyWithSeal::with(['projectInfo', 'dept'])->where($this->searchWhere)
->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc'])
->select()
->select()->each(function($data){
$contract = CostApprovedProject::field('project_director')->where('id',$data['projectInfo']['contract_id'])->findOrEmpty();
$data['project_director'] = $contract['project_director'];
})
->toArray();
}

View File

@ -15,6 +15,7 @@
namespace app\adminapi\logic\project_process_management;
use app\common\model\cost_project\CostApprovedProject;
use app\common\model\project_process_management\ApplyWithSeal;
use app\common\logic\BaseLogic;
use think\facade\Db;
@ -144,6 +145,8 @@ class ApplyWithSealLogic extends BaseLogic
public static function detail($params): array
{
$data = ApplyWithSeal::with(['projectInfo'])->findOrEmpty($params['id'])->toArray();
$contract = CostApprovedProject::field('project_director')->where('id',$data['projectInfo']['contract_id'])->findOrEmpty();
$data['project_director'] = $contract['project_director'];
return $data;
}
}