This commit is contained in:
weiz 2024-04-16 14:40:15 +08:00
parent 6c82588e34
commit 8b2c3127c3

View File

@ -75,7 +75,7 @@
->order(['id' => 'desc'])
->select()
->each(function ($res) {
$contract = MarketingContract::field('contract_name,part_a,part_b,signed_amount,create_time')->where('id', $res['contract_id'])->findOrEmpty();
$contract = MarketingContract::field('contract_name,contract_type,part_a,part_b,signed_amount,create_time')->where('id', $res['contract_id'])->findOrEmpty();
$province = GeoProvince::field('province_name')->where('province_code', $res['province'])->findOrEmpty();
$city = GeoCity::field('city_name')->where('city_code', $res['city'])->findOrEmpty();
$dept = Dept::field('name')->where('id', $res['depar'])->findOrEmpty();
@ -83,6 +83,7 @@
$custom = MarketingCustom::field('name')->where('id', $res['aunit'])->findOrEmpty();
$part_a = MarketingCustom::field('name')->where('id', $contract['part_a'])->findOrEmpty();
$res['contract_name'] = $contract?->contract_name;
$res['contract_type_text'] = $contract?->contract_type_text;
$res['part_a_name'] = $part_a?->name;
$res['part_b'] = $contract?->part_b;
$res['signed_amount'] = $contract?->signed_amount;
@ -106,7 +107,7 @@
->order(['id' => 'desc'])
->select()
->each(function ($res) {
$contract = MarketingContract::field('contract_name,part_a,part_b,signed_amount,create_time')->where('id', $res['contract_id'])->findOrEmpty();
$contract = MarketingContract::field('contract_name,contract_type,part_a,part_b,signed_amount,create_time')->where('id', $res['contract_id'])->findOrEmpty();
$province = GeoProvince::field('province_name')->where('province_code', $res['province'])->findOrEmpty();
$city = GeoCity::field('city_name')->where('city_code', $res['city'])->findOrEmpty();
$dept = Dept::field('name')->where('id', $res['depar'])->findOrEmpty();
@ -114,6 +115,7 @@
$custom = MarketingCustom::field('name')->where('id', $res['aunit'])->findOrEmpty();
$part_a = MarketingCustom::field('name')->where('id', $contract['part_a'])->findOrEmpty();
$res['contract_name'] = $contract?->contract_name;
$res['contract_type_text'] = $contract?->contract_type_text;
$res['part_a_name'] = $part_a?->name;
$res['part_b'] = $contract?->part_b;
$res['signed_amount'] = $contract?->signed_amount;