This commit is contained in:
weiz 2024-03-02 15:30:19 +08:00
parent e8af3d517e
commit 9c3a0776db

View File

@ -19,6 +19,7 @@ use app\adminapi\lists\BaseAdminDataLists;
use app\common\model\supervision_work\SupervisionMaterialEntry; use app\common\model\supervision_work\SupervisionMaterialEntry;
use app\common\model\supervision_work\SupervisionMaterialEntryDetail; use app\common\model\supervision_work\SupervisionMaterialEntryDetail;
use app\common\model\supervision_work\SupervisionProblem; use app\common\model\supervision_work\SupervisionProblem;
use app\common\model\supervision_work\SupervisionWitnessSampling;
use app\common\model\supervision_work\SupervisionWitnessSamplingDetail; use app\common\model\supervision_work\SupervisionWitnessSamplingDetail;
use app\common\lists\ListsSearchInterface; use app\common\lists\ListsSearchInterface;
@ -62,6 +63,7 @@ class SupervisionWitnessSamplingDetailLists extends BaseAdminDataLists implement
->limit($this->limitOffset, $this->limitLength) ->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc']) ->order(['id' => 'desc'])
->select()->each(function($data){ ->select()->each(function($data){
$witness_sampling = SupervisionWitnessSampling::field('sampling_date')->where('id',$data['witness_sampling_id'])->findOrEmpty();
$material_entry_detail = SupervisionMaterialEntryDetail::field('material_entry_id,name,brand,model,contract_brand,entry_number')->where('id',$data['material_entry_detail_id'])->findOrEmpty(); $material_entry_detail = SupervisionMaterialEntryDetail::field('material_entry_id,name,brand,model,contract_brand,entry_number')->where('id',$data['material_entry_detail_id'])->findOrEmpty();
$material_entry = SupervisionMaterialEntry::field('enter_time')->where('id',$material_entry_detail['material_entry_id'])->findOrEmpty(); $material_entry = SupervisionMaterialEntry::field('enter_time')->where('id',$material_entry_detail['material_entry_id'])->findOrEmpty();
$data['name'] = $material_entry_detail['name']; $data['name'] = $material_entry_detail['name'];
@ -70,6 +72,7 @@ class SupervisionWitnessSamplingDetailLists extends BaseAdminDataLists implement
$data['contract_brand'] = $material_entry_detail->contract_brand_text; $data['contract_brand'] = $material_entry_detail->contract_brand_text;
$data['entry_number'] = $material_entry_detail['entry_number']; $data['entry_number'] = $material_entry_detail['entry_number'];
$data['enter_time'] = $material_entry['$material_entry']; $data['enter_time'] = $material_entry['$material_entry'];
$data['sampling_date'] = $witness_sampling['sampling_date'];
$data['check_result_text'] = $data->check_result_text; $data['check_result_text'] = $data->check_result_text;
$data['problem_num'] = SupervisionProblem::field('id')->where('data_id',$data['id'])->where('data_type',5)->count(); $data['problem_num'] = SupervisionProblem::field('id')->where('data_id',$data['id'])->where('data_type',5)->count();
$data['reply_num'] = SupervisionProblem::field('id')->where('data_id',$data['id'])->where('data_type',5)->where('is_rectification',1)->count(); $data['reply_num'] = SupervisionProblem::field('id')->where('data_id',$data['id'])->where('data_type',5)->where('is_rectification',1)->count();