diff --git a/app/adminapi/lists/project_process_management/ProjectProgressPaymentLists.php b/app/adminapi/lists/project_process_management/ProjectProgressPaymentLists.php index c7393f93b..9fd3cc15b 100644 --- a/app/adminapi/lists/project_process_management/ProjectProgressPaymentLists.php +++ b/app/adminapi/lists/project_process_management/ProjectProgressPaymentLists.php @@ -59,6 +59,9 @@ class ProjectProgressPaymentLists extends BaseAdminDataLists implements ListsSea ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) ->select() + ->each(function($item){ + $item['annex'] = json_decode($item['annex'], true); + }) ->toArray(); } diff --git a/app/adminapi/logic/project_process_management/ProjectChangeVisaContentLogic.php b/app/adminapi/logic/project_process_management/ProjectChangeVisaContentLogic.php index 908ea0dc8..88fc9e903 100644 --- a/app/adminapi/logic/project_process_management/ProjectChangeVisaContentLogic.php +++ b/app/adminapi/logic/project_process_management/ProjectChangeVisaContentLogic.php @@ -41,7 +41,7 @@ class ProjectChangeVisaContentLogic extends BaseLogic Db::startTrans(); try { ProjectChangeVisaContent::create([ - 'project_change_visa_dataid' => $params['project_change_visa_dataid'], + 'project_progress_payment_id' => $params['project_progress_payment_id'], 'directory' => $params['directory'], 'unit_name' => $params['unit_name'], 'time' => $params['time'], diff --git a/app/adminapi/logic/project_process_management/ProjectProgressPaymentLogic.php b/app/adminapi/logic/project_process_management/ProjectProgressPaymentLogic.php index a4b2c01bd..4b08b057e 100644 --- a/app/adminapi/logic/project_process_management/ProjectProgressPaymentLogic.php +++ b/app/adminapi/logic/project_process_management/ProjectProgressPaymentLogic.php @@ -40,7 +40,7 @@ class ProjectProgressPaymentLogic extends BaseLogic { Db::startTrans(); try { - ProjectProgressPayment::create([ + $p = ProjectProgressPayment::create([ 'dataid' => generate_sn(ProjectProgressPayment::class, 'dataid'), 'num' => generate_sn(ProjectProgressPayment::class, 'num'), 'project_id' => $params['project_id'], @@ -49,9 +49,12 @@ class ProjectProgressPaymentLogic extends BaseLogic 'sbhj' => $params['sbhj'], 'shhj' => $params['shhj'], 'ljhj' => $params['ljhj'], - 'annex' => $params['annex'], + 'annex' => json_encode($params['annex']) ]); - + foreach ($params['project_progress_payment_detail'] as $item) { + $item['project_progress_payment_id'] = $p->id; + ProjectChangeVisaContentLogic::add($item); + } Db::commit(); return true; } catch (\Exception $e) { @@ -80,7 +83,7 @@ class ProjectProgressPaymentLogic extends BaseLogic 'sbhj' => $params['sbhj'], 'shhj' => $params['shhj'], 'ljhj' => $params['ljhj'], - 'annex' => $params['annex'], + 'annex' => json_encode($params['annex']) ]); Db::commit(); @@ -115,6 +118,8 @@ class ProjectProgressPaymentLogic extends BaseLogic */ public static function detail($params): array { - return ProjectProgressPayment::with(['projectInfo'])->findOrEmpty($params['id'])->toArray(); + $data = ProjectProgressPayment::with(['projectInfo'])->findOrEmpty($params['id'])->toArray(); + $data['annex'] = json_decode($data['annex'], true); + return $data; } } \ No newline at end of file