This commit is contained in:
weiz 2024-03-02 15:22:12 +08:00
parent cbefd79821
commit e8af3d517e

View File

@ -16,6 +16,7 @@ namespace app\adminapi\lists\supervision_work;
use app\adminapi\lists\BaseAdminDataLists;
use app\common\model\supervision_work\SupervisionMaterialEntry;
use app\common\model\supervision_work\SupervisionMaterialEntryDetail;
use app\common\model\supervision_work\SupervisionProblem;
use app\common\model\supervision_work\SupervisionWitnessSamplingDetail;
@ -61,12 +62,14 @@ class SupervisionWitnessSamplingDetailLists extends BaseAdminDataLists implement
->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc'])
->select()->each(function($data){
$material_entry_detail = SupervisionMaterialEntryDetail::field('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();
$data['name'] = $material_entry_detail['name'];
$data['brand'] = $material_entry_detail['brand'];
$data['model'] = $material_entry_detail['model'];
$data['contract_brand'] = $material_entry_detail->contract_brand_text;
$data['entry_number'] = $material_entry_detail['entry_number'];
$data['enter_time'] = $material_entry['$material_entry'];
$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['reply_num'] = SupervisionProblem::field('id')->where('data_id',$data['id'])->where('data_type',5)->where('is_rectification',1)->count();