申请明细-更新custom_name
This commit is contained in:
parent
ff58c36407
commit
8a195679f3
@ -23,7 +23,7 @@ use app\common\model\material\MaterialPurchaseRequestDetail;
|
||||
use app\common\lists\ListsSearchInterface;
|
||||
use app\common\model\project\Project;
|
||||
use app\common\model\project\ProjectMaterialBudgetDetail;
|
||||
|
||||
use think\facade\Db;
|
||||
|
||||
/**
|
||||
* 材料采购申请明细列表
|
||||
@ -71,11 +71,12 @@ class MaterialPurchaseRequestDetailLists extends BaseAdminDataLists implements L
|
||||
->order(['id' => 'desc'])
|
||||
->select()->each(function($data){
|
||||
$material_purchase_request = MaterialPurchaseRequest::field('material_purchase_request_code,project_id,apply_date,arrival_date')->where('id',$data['material_purchase_request_id'])->findOrEmpty();
|
||||
$project = Project::field('name,project_code')->where('id',$material_purchase_request['project_id'])->findOrEmpty();
|
||||
$project_material_budget_detail = ProjectMaterialBudgetDetail::field('material_id')->where('id',$data['project_material_budget_detail_id'])->findOrEmpty();
|
||||
$project = Project::where('id',$material_purchase_request['project_id'])->field('name,project_code,custom_id')->findOrEmpty();
|
||||
$project_material_budget_detail = ProjectMaterialBudgetDetail::field('material_id')->where('id',$data['project_material_budget_detail_id'])->findOrEmpty();
|
||||
$material = Material::field('first_level,second_level,three_level,name,code,specs,brand,parameter_description,unit')->where('id',$project_material_budget_detail['material_id'])->findOrEmpty();
|
||||
$material_classify = MaterialClassify::where('id','in',[$material['first_level'],$material['second_level'],$material['three_level']])->column('name','id');
|
||||
$data['material_purchase_request_code'] = $material_purchase_request['material_purchase_request_code'];
|
||||
$data['custom_name'] = Db::name('custom')->where('id',$project['custom_id'])->value('name');
|
||||
$data['project_name'] = $project['name'];
|
||||
$data['project_code'] = $project['project_code'];
|
||||
$data['apply_date'] = $material_purchase_request['apply_date'];
|
||||
|
Loading…
x
Reference in New Issue
Block a user