This commit is contained in:
chenbo 2024-02-29 10:01:47 +08:00
parent fa35b0f229
commit 53d348f1dd
3 changed files with 13 additions and 1 deletions

View File

@ -18,6 +18,7 @@ namespace app\adminapi\lists\project_process_management;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\model\project_process_management\ProjectChangeVisa;
use app\common\lists\ListsSearchInterface;
use app\common\model\project_process_management\ProjectChangeVisaContent;
/**
@ -56,9 +57,14 @@ class ProjectChangeVisaLists extends BaseAdminDataLists implements ListsSearchIn
public function lists(): array
{
return ProjectChangeVisa::with(['projectInfo'])
->append(['children'])
->where($this->searchWhere)
->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc'])
->withAttr('children', function ($value, $data){
$details = ProjectChangeVisaContent::where('project_change_visa_id', $data['id'])->select();
return $details;
})
->select()
->toArray();
}

View File

@ -18,6 +18,7 @@ namespace app\adminapi\lists\project_process_management;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\model\project_process_management\ProjectProgressPayment;
use app\common\lists\ListsSearchInterface;
use app\common\model\project_process_management\ProjectProgressPaymentDetail;
/**
@ -56,8 +57,13 @@ class ProjectProgressPaymentLists extends BaseAdminDataLists implements ListsSea
public function lists(): array
{
return ProjectProgressPayment::with(['projectInfo'])->where($this->searchWhere)
->append(['children'])
->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc'])
->withAttr('children', function ($value, $data){
$details = ProjectProgressPaymentDetail::where('project_progress_payment_id', $data['id'])->select();
return $details;
})
->select()
->each(function($item){
$item['annex'] = json_decode($item['annex'], true);

View File

@ -53,7 +53,7 @@ class ProjectProgressPaymentLogic extends BaseLogic
]);
foreach ($params['project_progress_payment_detail'] as $item) {
$item['project_progress_payment_id'] = $p->id;
ProjectChangeVisaContentLogic::add($item);
ProjectProgressPaymentDetailLogic::add($item);
}
Db::commit();
return true;