This commit is contained in:
weiz 2024-04-01 15:59:56 +08:00
parent e51d9ed831
commit 69dff92c93

View File

@ -15,13 +15,13 @@
namespace app\adminapi\logic\project; namespace app\adminapi\logic\project;
use app\common\logic\BaseLogic;
use app\common\model\auth\Admin; use app\common\model\auth\Admin;
use app\common\model\custom\Custom; use app\common\model\custom\Custom;
use app\common\model\custom\CustomContacts; use app\common\model\custom\CustomContacts;
use app\common\model\custom\CustomerDemand; use app\common\model\custom\CustomerDemand;
use app\common\model\project\Project; use app\common\model\project\Project;
use app\common\model\project\ProjectEstimate; use app\common\model\project\ProjectEstimate;
use app\common\logic\BaseLogic;
use think\facade\Db; use think\facade\Db;
@ -134,7 +134,7 @@ class ProjectEstimateLogic extends BaseLogic
$data['invoice_type_text'] = $data->invoice_type_text; $data['invoice_type_text'] = $data->invoice_type_text;
$project = Project::field('name,project_code,custom_id')->where('id', $data['project_id'])->findOrEmpty(); $project = Project::field('name,project_code,custom_id')->where('id', $data['project_id'])->findOrEmpty();
$custom = Custom::field('name')->where('id', $project['custom_id'])->findOrEmpty(); $custom = Custom::field('name')->where('id', $project['custom_id'])->findOrEmpty();
$demand = CustomerDemand::field('theme')->where('id',$data['customer_demand_id'])->findOrEmpty(); $demand = CustomerDemand::field('theme,recording_time')->where('id', $data['customer_demand_id'])->findOrEmpty();
$contract = CustomContacts::field('name,phone')->where('id', $data['contact_id'])->findOrEmpty(); $contract = CustomContacts::field('name,phone')->where('id', $data['contact_id'])->findOrEmpty();
$technician = Admin::field('name')->where('id', $data['technician'])->findOrEmpty(); $technician = Admin::field('name')->where('id', $data['technician'])->findOrEmpty();
$admin = Admin::where('id', 'in', [$data['add_user'], $data['update_user']])->column('name', 'id'); $admin = Admin::where('id', 'in', [$data['add_user'], $data['update_user']])->column('name', 'id');
@ -142,6 +142,7 @@ class ProjectEstimateLogic extends BaseLogic
$data['project_code'] = $project['project_code']; $data['project_code'] = $project['project_code'];
$data['custom_name'] = $custom['name']; $data['custom_name'] = $custom['name'];
$data['customer_demand_name'] = $demand['theme']; $data['customer_demand_name'] = $demand['theme'];
$data['recording_time'] = $demand['recording_time'];
$data['contact_name'] = $contract['name']; $data['contact_name'] = $contract['name'];
$data['contact_phone'] = $contract['phone']; $data['contact_phone'] = $contract['phone'];
$data['technician_name'] = $technician['name']; $data['technician_name'] = $technician['name'];