update
This commit is contained in:
parent
3c3292b32f
commit
cef2a033a6
@ -70,7 +70,7 @@ class CustomServiceLists extends BaseAdminDataLists implements ListsSearchInterf
|
||||
$item['classification'] = $item->classification_text;
|
||||
$item['processing_result'] = $item->processing_result_text;
|
||||
$item['urgency'] = $item->urgency_text;
|
||||
$item['is_solve'] = $item->is_solve_text;
|
||||
$item['is_solve_text'] = $item->is_solve_text;
|
||||
$project = Project::field('name,project_code')->where('id',$item['project_id'])->findOrEmpty();
|
||||
$custom = Custom::field('name,master_name,master_phone')->where('id',$project['custom_id'])->findOrEmpty();
|
||||
$contract = Contract::field('contract_code')->where('id',$item['contract_id'])->findOrEmpty();
|
||||
|
@ -42,7 +42,7 @@ class CustomerDemandLists extends BaseAdminDataLists implements ListsSearchInter
|
||||
public function setSearch(): array
|
||||
{
|
||||
return [
|
||||
'=' => ['importance', 'recording_time'],
|
||||
'=' => ['project_id','importance', 'recording_time'],
|
||||
'%like%' => ['theme', 'supplier', 'supplier_contacts']
|
||||
];
|
||||
}
|
||||
@ -75,12 +75,11 @@ class CustomerDemandLists extends BaseAdminDataLists implements ListsSearchInter
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->order(['id' => 'desc'])
|
||||
->select()->each(function($item){
|
||||
$item['importance_text'] = $item->importance_text;
|
||||
$item['recording_time'] = date('Y-m-d H:i:s',$item['recording_time']);
|
||||
$project = Project::field('name,custom_id')->where('id',$item['project_id'])->findOrEmpty();
|
||||
$custom = Custom::field('name')->where('id',$project['custom_id'])->findOrEmpty();
|
||||
$item['project_name'] = $project['name'];
|
||||
$item['custom_name'] = $custom['name'];
|
||||
$item['importance_text'] = $item->importance_text;
|
||||
return $item;
|
||||
})
|
||||
->toArray();
|
||||
|
@ -41,7 +41,7 @@ class ProjectFollowUpLists extends BaseAdminDataLists implements ListsSearchInte
|
||||
public function setSearch(): array
|
||||
{
|
||||
return [
|
||||
'=' => ['follow_type', 'project_assurance', 'follow_status', 'follow_stage'],
|
||||
'=' => ['project_id','follow_type', 'project_assurance', 'follow_status', 'follow_stage'],
|
||||
'%like%' => ['executor','theme','contacts','contact_information'],
|
||||
];
|
||||
}
|
||||
@ -74,16 +74,14 @@ class ProjectFollowUpLists extends BaseAdminDataLists implements ListsSearchInte
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->order(['id' => 'desc'])
|
||||
->select()->each(function($item){
|
||||
$item['follow_type_text'] = $item->follow_type_text;
|
||||
$item['project_assurance_text'] = $item->project_assurance_text;
|
||||
$item['follow_status_text'] = $item->follow_status_text;
|
||||
$item['follow_stage_text'] = $item->follow_stage_text;
|
||||
$item['follow_date'] = !empty($item['follow_date']) ? date('Y-m-d',$item['follow_date']) : '';
|
||||
$item['next_follow_up_date'] = !empty($item['next_follow_up_date']) ? date('Y-m-d',$item['next_follow_up_date']) : '';
|
||||
$project = Project::field('id,custom_id,name')->where('id',$item['project_id'])->findOrEmpty();
|
||||
$custom = Custom::field('name')->where('id',$project['custom_id'])->findOrEmpty();
|
||||
$item['project_name'] = $project['name'];
|
||||
$item['custom_name'] = $custom['name'];
|
||||
$item['follow_type_text'] = $item->follow_type_text;
|
||||
$item['project_assurance_text'] = $item->project_assurance_text;
|
||||
$item['follow_status_text'] = $item->follow_status_text;
|
||||
$item['follow_stage_text'] = $item->follow_stage_text;
|
||||
return $item;
|
||||
})
|
||||
->toArray();
|
||||
|
@ -17,6 +17,8 @@ namespace app\adminapi\lists\project;
|
||||
|
||||
use app\adminapi\lists\BaseAdminDataLists;
|
||||
use app\common\model\custom\Custom;
|
||||
use app\common\model\dept\Dept;
|
||||
use app\common\model\dept\Orgs;
|
||||
use app\common\model\project\Project;
|
||||
use app\common\lists\ListsSearchInterface;
|
||||
use app\common\model\project\ProjectTypeSet;
|
||||
@ -40,7 +42,7 @@ class ProjectLists extends BaseAdminDataLists implements ListsSearchInterface
|
||||
public function setSearch(): array
|
||||
{
|
||||
return [
|
||||
'=' => ['custom_id', 'status','project_type','strategic_significance','industry','unit_nature','bidding_method','information_sources'],
|
||||
'=' => ['custom_id','status','project_type','project_content','strategic_significance','industry','unit_nature','information_sources'],
|
||||
'%like%' => ['project_code','name','project_address','person']
|
||||
];
|
||||
}
|
||||
@ -64,14 +66,29 @@ class ProjectLists extends BaseAdminDataLists implements ListsSearchInterface
|
||||
$condition[] = ['custom_id','in',$customIds];
|
||||
}
|
||||
return Project::where($this->searchWhere)->where($condition)
|
||||
->field(['id','custom_id','project_code','name','status','contacts','telephone','project_address','project_type','strategic_significance','industry','unit_nature','bidding_method','information_sources','person'])
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->order(['id' => 'desc'])
|
||||
->select()->each(function($item){
|
||||
$org = Orgs::field('name')->where('id',$item['org_id'])->findOrEmpty();
|
||||
$dept = Dept::field('name')->where('id',$item['dept_id'])->findOrEmpty();
|
||||
$projectType = ProjectTypeSet::where('id',$item['project_type'])->findOrEmpty();
|
||||
$custom = Custom::field('name')->where('id',$item['custom_id'])->findOrEmpty();
|
||||
$item['custom_name'] = $custom->isEmpty() ? '' : $custom['name'];
|
||||
$item['project_type_name'] = $projectType->isEmpty() ? '' : $projectType['name'];
|
||||
$item['org_name'] = $org['name'];
|
||||
$item['dept_name'] = $dept['name'];
|
||||
$item['custom_name'] = $custom['name'];
|
||||
$item['project_type'] = $projectType['name'];
|
||||
$item['status'] = $item->status_text;
|
||||
$item['project_content'] = $item->project_content_text;
|
||||
$item['bidding_method'] = $item->bidding_method_text;
|
||||
$item['relationship'] = $item->relationship_text;
|
||||
$item['information_sources'] = $item->information_sources_text;
|
||||
$item['construction_funds_sources'] = $item->construction_funds_sources_text;
|
||||
$item['construction_financial_status'] = $item->construction_financial_status_text;
|
||||
$item['construction_recognition'] = $item->construction_recognition_text;
|
||||
$item['my_construction_recognition'] = $item->my_construction_recognition_text;
|
||||
$item['strategic_significance'] = $item->strategic_significance_text;
|
||||
$item['industry'] = $item->industry_text;
|
||||
$item['unit_nature'] = $item->unit_nature_text;
|
||||
return $item;
|
||||
})
|
||||
->toArray();
|
||||
@ -86,7 +103,13 @@ class ProjectLists extends BaseAdminDataLists implements ListsSearchInterface
|
||||
*/
|
||||
public function count(): int
|
||||
{
|
||||
return Project::where($this->searchWhere)->count();
|
||||
$params = $this->request->param();
|
||||
$condition = [];
|
||||
if(isset($params['custom_name']) && $params['custom_name'] != ''){
|
||||
$customIds = Custom::where('name','like','%'.$params['custom_name'].'%')->column('id');
|
||||
$condition[] = ['custom_id','in',$customIds];
|
||||
}
|
||||
return Project::where($this->searchWhere)->where($condition)->count();
|
||||
}
|
||||
|
||||
}
|
@ -69,7 +69,7 @@ class ProjectPreSalesMembersLists extends BaseAdminDataLists implements ListsSea
|
||||
$where[] = ['project_id','in',$projectIds];
|
||||
}
|
||||
return ProjectPreSalesMembers::where($this->searchWhere)->where($where)
|
||||
->field(['id,project_id,technician_ids,business_people_ids,cross_departmental_personnel_ids,add_people,create_time'])
|
||||
->field(['id,project_id,technician_ids,business_people_ids,cross_departmental_personnel_ids,add_user,create_time'])
|
||||
->limit($this->limitOffset, $this->limitLength)
|
||||
->order(['id' => 'desc'])
|
||||
->select()->each(function($item){
|
||||
@ -78,13 +78,13 @@ class ProjectPreSalesMembersLists extends BaseAdminDataLists implements ListsSea
|
||||
$technician = Admin::where('id','in',$item['technician_ids'])->column('name');
|
||||
$business_people = Admin::where('id','in',$item['business_people_ids'])->column('name');
|
||||
$cross_departmental_personnel = Admin::where('id','in',$item['cross_departmental_personnel_ids'])->column('name');
|
||||
$add_people = Admin::field('name')->where('id',$item['add_people'])->findOrEmpty();
|
||||
$add_user = Admin::field('name')->where('id',$item['add_user'])->findOrEmpty();
|
||||
$item['project_name'] = $project['name'];
|
||||
$item['custom_name'] = $custom['name'];
|
||||
$item['technician'] = implode(',',$technician);
|
||||
$item['business_people'] = implode(',',$business_people);
|
||||
$item['cross_departmental_personnel'] = implode(',',$cross_departmental_personnel);
|
||||
$item['add_people'] = $add_people['name'];
|
||||
$item['add_user'] = $add_user['name'];
|
||||
unset($item['technician_ids'],$item['business_people_ids'],$item['cross_departmental_personnel_ids']);
|
||||
})
|
||||
->toArray();
|
||||
|
@ -49,12 +49,12 @@ class CustomerDemandLogic extends BaseLogic
|
||||
'dept_id' => $params['dept_id'],
|
||||
'project_id' => $params['project_id'],
|
||||
'theme' => $params['theme'],
|
||||
'supplier' => $params['supplier'],
|
||||
'supplier_contacts' => $params['supplier_contacts'],
|
||||
'supplier' => $params['supplier'] ?? '',
|
||||
'supplier_contacts' => $params['supplier_contacts'] ?? '',
|
||||
'importance' => $params['importance'],
|
||||
'recording_time' => strtotime($params['recording_time']),
|
||||
'demand_content' => $params['demand_content'],
|
||||
'annex' => $params['annex']
|
||||
'demand_content' => $params['demand_content'] ?? '',
|
||||
'annex' => !empty($params['annex']) ? $params['annex'] : null,
|
||||
]);
|
||||
Db::commit();
|
||||
return true;
|
||||
@ -78,16 +78,17 @@ class CustomerDemandLogic extends BaseLogic
|
||||
Db::startTrans();
|
||||
try {
|
||||
CustomerDemand::where('id', $params['id'])->update([
|
||||
'org_id' => $params['org_id'],
|
||||
'dept_id' => $params['dept_id'],
|
||||
'project_id' => $params['project_id'],
|
||||
'theme' => $params['theme'],
|
||||
'supplier' => $params['supplier'],
|
||||
'supplier_contacts' => $params['supplier_contacts'],
|
||||
'importance' => $params['importance'],
|
||||
'recording_time' => strtotime($params['recording_time']),
|
||||
'demand_content' => $params['demand_content'],
|
||||
'annex' => $params['annex']
|
||||
'org_id' => $params['org_id'],
|
||||
'dept_id' => $params['dept_id'],
|
||||
'project_id' => $params['project_id'],
|
||||
'theme' => $params['theme'],
|
||||
'supplier' => $params['supplier'] ?? '',
|
||||
'supplier_contacts' => $params['supplier_contacts'] ?? '',
|
||||
'importance' => $params['importance'],
|
||||
'recording_time' => strtotime($params['recording_time']),
|
||||
'demand_content' => $params['demand_content'] ?? '',
|
||||
'annex' => !empty($params['annex']) ? $params['annex'] : null,
|
||||
'update_time' => time(),
|
||||
]);
|
||||
Db::commit();
|
||||
return true;
|
||||
@ -122,8 +123,6 @@ class CustomerDemandLogic extends BaseLogic
|
||||
public static function detail($params): array
|
||||
{
|
||||
$data = CustomerDemand::field('id,org_id,dept_id,project_id,theme,supplier,supplier_contacts,importance,recording_time,demand_content,annex')->findOrEmpty($params['id']);
|
||||
$data['importance_text'] = $data->importance_text;
|
||||
$data['recording_time'] = date('Y-m-d H:i:s',$data['recording_time']);
|
||||
$org = Orgs::field('name')->where('id',$data['org_id'])->findOrEmpty();
|
||||
$dept = Dept::field('name')->where('id',$data['dept_id'])->findOrEmpty();
|
||||
$project = Project::field('name,project_code,custom_id')->where('id',$data['project_id'])->findOrEmpty();
|
||||
@ -133,6 +132,7 @@ class CustomerDemandLogic extends BaseLogic
|
||||
$data['project_name'] = $project['name'];
|
||||
$data['project_code'] = $project['project_code'];
|
||||
$data['custom_name'] = $custom['name'];
|
||||
$data['importance_text'] = $data->importance_text;
|
||||
return $data->toArray();
|
||||
}
|
||||
}
|
@ -44,22 +44,26 @@ class ProjectFollowUpLogic extends BaseLogic
|
||||
try {
|
||||
ProjectFollowUp::create([
|
||||
'project_id' => $params['project_id'],
|
||||
'executor' => $params['executor'],
|
||||
'contacts' => $params['contacts'],
|
||||
'contact_information' => $params['contact_information'],
|
||||
'project_role' => $params['project_role'],
|
||||
'position' => $params['position'],
|
||||
'executor' => $params['executor'] ?? '',
|
||||
'contacts' => $params['contacts'] ?? '',
|
||||
'contact_information' => $params['contact_information'] ?? '',
|
||||
'project_role' => $params['project_role'] ?? '',
|
||||
'position' => $params['position'] ?? '',
|
||||
'follow_date' => strtotime($params['follow_date']),
|
||||
'follow_type' => $params['follow_type'],
|
||||
'theme' => $params['theme'],
|
||||
'action_description' => $params['action_description'],
|
||||
'action_description' => $params['action_description'] ?? '',
|
||||
'project_assurance' => $params['project_assurance'],
|
||||
'follow_status' => $params['follow_status'],
|
||||
'follow_stage' => $params['follow_stage'],
|
||||
'notes' => $params['notes'],
|
||||
'next_follow_up_date' => strtotime($params['next_follow_up_date']),
|
||||
'file' => $params['file']
|
||||
'notes' => $params['notes'] ?? '',
|
||||
'next_follow_up_date' => !empty($params['next_follow_up_date']) ? strtotime($params['next_follow_up_date']) : 0,
|
||||
'file' => !empty($params['file']) ? $params['file'] : null,
|
||||
]);
|
||||
Project::where('id', $params['project_id'])->update([
|
||||
'status' => 6,
|
||||
'update_time' => time()
|
||||
]);
|
||||
Db::commit();
|
||||
return true;
|
||||
} catch (\Exception $e) {
|
||||
@ -82,22 +86,23 @@ class ProjectFollowUpLogic extends BaseLogic
|
||||
Db::startTrans();
|
||||
try {
|
||||
ProjectFollowUp::where('id', $params['id'])->update([
|
||||
'project_id' => $params['project_id'],
|
||||
'executor' => $params['executor'],
|
||||
'contacts' => $params['contacts'],
|
||||
'contact_information' => $params['contact_information'],
|
||||
'project_role' => $params['project_role'],
|
||||
'position' => $params['position'],
|
||||
'follow_date' => strtotime($params['follow_date']),
|
||||
'follow_type' => $params['follow_type'],
|
||||
'theme' => $params['theme'],
|
||||
'action_description' => $params['action_description'],
|
||||
'project_assurance' => $params['project_assurance'],
|
||||
'follow_status' => $params['follow_status'],
|
||||
'follow_stage' => $params['follow_stage'],
|
||||
'notes' => $params['notes'],
|
||||
'next_follow_up_date' => strtotime($params['next_follow_up_date']),
|
||||
'file' => $params['file']
|
||||
'project_id' => $params['project_id'],
|
||||
'executor' => $params['executor'] ?? '',
|
||||
'contacts' => $params['contacts'] ?? '',
|
||||
'contact_information' => $params['contact_information'] ?? '',
|
||||
'project_role' => $params['project_role'] ?? '',
|
||||
'position' => $params['position'] ?? '',
|
||||
'follow_date' => strtotime($params['follow_date']),
|
||||
'follow_type' => $params['follow_type'],
|
||||
'theme' => $params['theme'],
|
||||
'action_description' => $params['action_description'] ?? '',
|
||||
'project_assurance' => $params['project_assurance'],
|
||||
'follow_status' => $params['follow_status'],
|
||||
'follow_stage' => $params['follow_stage'],
|
||||
'notes' => $params['notes'] ?? '',
|
||||
'next_follow_up_date' => !empty($params['next_follow_up_date']) ? strtotime($params['next_follow_up_date']) : 0,
|
||||
'file' => !empty($params['file']) ? $params['file'] : null,
|
||||
'update_time' => time(),
|
||||
]);
|
||||
Db::commit();
|
||||
return true;
|
||||
@ -132,18 +137,15 @@ class ProjectFollowUpLogic extends BaseLogic
|
||||
public static function detail($params): array
|
||||
{
|
||||
$data = ProjectFollowUp::findOrEmpty($params['id']);
|
||||
$data['follow_type_text'] = $data->follow_type_text;
|
||||
$data['project_assurance_text'] = $data->project_assurance_text;
|
||||
$data['follow_status_text'] = $data->follow_status_text;
|
||||
$data['follow_stage_text'] = $data->follow_stage_text;
|
||||
$data['follow_date'] = !empty($data['follow_date']) ? date('Y-m-d',$data['follow_date']) : '';
|
||||
$data['next_follow_up_date'] = !empty($data['next_follow_up_date']) ? date('Y-m-d',$data['next_follow_up_date']) : '';
|
||||
$project = Project::field('id,custom_id,name,project_code')->where('id',$data['project_id'])->findOrEmpty();
|
||||
$custom = Custom::field('name')->where('id',$project['custom_id'])->findOrEmpty();
|
||||
$data['project_name'] = $project['name'];
|
||||
$data['project_code'] = $project['project_code'];
|
||||
$data['custom_name'] = $custom['name'];
|
||||
unset($data['delete_time']);
|
||||
$data['follow_type_text'] = $data->follow_type_text;
|
||||
$data['project_assurance_text'] = $data->project_assurance_text;
|
||||
$data['follow_status_text'] = $data->follow_status_text;
|
||||
$data['follow_stage_text'] = $data->follow_stage_text;
|
||||
return $data->toArray();
|
||||
}
|
||||
}
|
@ -16,6 +16,8 @@ namespace app\adminapi\logic\project;
|
||||
|
||||
|
||||
use app\common\model\custom\Custom;
|
||||
use app\common\model\dept\Dept;
|
||||
use app\common\model\dept\Orgs;
|
||||
use app\common\model\project\Project;
|
||||
use app\common\logic\BaseLogic;
|
||||
use app\common\model\project\ProjectTypeSet;
|
||||
@ -43,38 +45,39 @@ class ProjectLogic extends BaseLogic
|
||||
Db::startTrans();
|
||||
try {
|
||||
Project::create([
|
||||
'org_id' => $params['org_id'],
|
||||
'dept_id' => $params['dept_id'],
|
||||
'custom_id' => $params['custom_id'],
|
||||
'name' => $params['name'],
|
||||
'project_type' => $params['project_type'],
|
||||
'project_code' => data_unique_code('P'),
|
||||
'project_content' => $params['project_content'],
|
||||
'project_estimation' => $params['project_estimation'],
|
||||
'project_address' => $params['project_address'],
|
||||
'estimated_construction' => $params['estimated_construction'],
|
||||
'bidding_time' => strtotime($params['bidding_time']),
|
||||
'bidding_method' => $params['bidding_method'],
|
||||
'contacts' => $params['contacts'],
|
||||
'position' => $params['position'],
|
||||
'telephone' => $params['telephone'],
|
||||
'department' => $params['department'],
|
||||
'person' => $params['person'],
|
||||
'relationship' => $params['relationship'],
|
||||
'project_content' => $params['project_content'] ?? 0,
|
||||
'project_estimation' => $params['project_estimation'] ?? 0,
|
||||
'project_address' => $params['project_address'] ?? '',
|
||||
'estimated_construction' => $params['estimated_construction'] ?? '',
|
||||
'bidding_time' => !empty($params['bidding_time']) ? strtotime($params['bidding_time']) : 0,
|
||||
'bidding_method' => $params['bidding_method'] ?? 0,
|
||||
'contacts' => $params['contacts'] ?? '',
|
||||
'position' => $params['position'] ?? '',
|
||||
'telephone' => $params['telephone'] ?? '',
|
||||
'department' => $params['department'] ?? '',
|
||||
'person' => $params['person'] ?? '',
|
||||
'relationship' => $params['relationship'] ?? 0,
|
||||
'discovery_time' => strtotime($params['discovery_time']),
|
||||
'information_sources' => $params['information_sources'],
|
||||
'competitor' => $params['competitor'],
|
||||
'construction_funds_sources' => $params['construction_funds_sources'],
|
||||
'construction_payment_method' => $params['construction_payment_method'],
|
||||
'construction_financial_status' => $params['construction_financial_status'],
|
||||
'construction_recognition' => $params['construction_recognition'],
|
||||
'my_construction_recognition' => $params['my_construction_recognition'],
|
||||
'strategic_significance' => $params['strategic_significance'],
|
||||
'industry' => $params['industry'],
|
||||
'unit_nature' => $params['unit_nature'],
|
||||
'annex' => $params['annex'],
|
||||
'status' => 0,
|
||||
'competitor' => $params['competitor'] ?? '',
|
||||
'construction_funds_sources' => $params['construction_funds_sources'] ?? 0,
|
||||
'construction_payment_method' => $params['construction_payment_method'] ?? '',
|
||||
'construction_financial_status' => $params['construction_financial_status'] ?? 0,
|
||||
'construction_recognition' => $params['construction_recognition'] ?? 0,
|
||||
'my_construction_recognition' => $params['my_construction_recognition'] ?? 0,
|
||||
'strategic_significance' => $params['strategic_significance'] ?? 0,
|
||||
'industry' => $params['industry'] ?? 0,
|
||||
'unit_nature' => $params['unit_nature'] ?? 0,
|
||||
'annex' => $params['annex'] ?? null,
|
||||
'status' => 1,
|
||||
'add_user' => $adminId
|
||||
]);
|
||||
|
||||
Db::commit();
|
||||
return true;
|
||||
} catch (\Exception $e) {
|
||||
@ -97,35 +100,38 @@ class ProjectLogic extends BaseLogic
|
||||
Db::startTrans();
|
||||
try {
|
||||
Project::where('id', $params['id'])->update([
|
||||
'custom_id' => $params['custom_id'],
|
||||
'org_id' => $params['org_id'],
|
||||
'dept_id' => $params['dept_id'],
|
||||
'custom_id' => $params['custom_id'],
|
||||
'name' => $params['name'],
|
||||
'project_type' => $params['project_type'],
|
||||
'project_content' => $params['project_content'],
|
||||
'project_estimation' => $params['project_estimation'],
|
||||
'project_address' => $params['project_address'],
|
||||
'estimated_construction' => $params['estimated_construction'],
|
||||
'bidding_time' => strtotime($params['bidding_time']),
|
||||
'bidding_method' => $params['bidding_method'],
|
||||
'contacts' => $params['contacts'],
|
||||
'position' => $params['position'],
|
||||
'telephone' => $params['telephone'],
|
||||
'department' => $params['department'],
|
||||
'person' => $params['person'],
|
||||
'relationship' => $params['relationship'],
|
||||
'discovery_time' => strtotime($params['discovery_time']),
|
||||
'information_sources' => $params['information_sources'],
|
||||
'competitor' => $params['competitor'],
|
||||
'construction_funds_sources' => $params['construction_funds_sources'],
|
||||
'construction_payment_method' => $params['construction_payment_method'],
|
||||
'construction_financial_status' => $params['construction_financial_status'],
|
||||
'construction_recognition' => $params['construction_recognition'],
|
||||
'my_construction_recognition' => $params['my_construction_recognition'],
|
||||
'strategic_significance' => $params['strategic_significance'],
|
||||
'industry' => $params['industry'],
|
||||
'unit_nature' => $params['unit_nature'],
|
||||
'annex' => $params['annex'],
|
||||
'project_type' => $params['project_type'],
|
||||
'project_code' => data_unique_code('P'),
|
||||
'project_content' => $params['project_content'] ?? 0,
|
||||
'project_estimation' => $params['project_estimation'] ?? 0,
|
||||
'project_address' => $params['project_address'] ?? '',
|
||||
'estimated_construction' => $params['estimated_construction'] ?? '',
|
||||
'bidding_time' => !empty($params['bidding_time']) ? strtotime($params['bidding_time']) : 0,
|
||||
'bidding_method' => $params['bidding_method'] ?? 0,
|
||||
'contacts' => $params['contacts'] ?? '',
|
||||
'position' => $params['position'] ?? '',
|
||||
'telephone' => $params['telephone'] ?? '',
|
||||
'department' => $params['department'] ?? '',
|
||||
'person' => $params['person'] ?? '',
|
||||
'relationship' => $params['relationship'] ?? 0,
|
||||
'discovery_time' => strtotime($params['discovery_time']),
|
||||
'information_sources' => $params['information_sources'],
|
||||
'competitor' => $params['competitor'] ?? '',
|
||||
'construction_funds_sources' => $params['construction_funds_sources'] ?? 0,
|
||||
'construction_payment_method' => $params['construction_payment_method'] ?? '',
|
||||
'construction_financial_status' => $params['construction_financial_status'] ?? 0,
|
||||
'construction_recognition' => $params['construction_recognition'] ?? 0,
|
||||
'my_construction_recognition' => $params['my_construction_recognition'] ?? 0,
|
||||
'strategic_significance' => $params['strategic_significance'] ?? 0,
|
||||
'industry' => $params['industry'] ?? 0,
|
||||
'unit_nature' => $params['unit_nature'] ?? 0,
|
||||
'annex' => $params['annex'] ?? null,
|
||||
'update_time' => time(),
|
||||
]);
|
||||
|
||||
Db::commit();
|
||||
return true;
|
||||
} catch (\Exception $e) {
|
||||
@ -158,11 +164,27 @@ class ProjectLogic extends BaseLogic
|
||||
*/
|
||||
public static function detail($params): array
|
||||
{
|
||||
$data = Project::findOrEmpty($params['id'])->toArray();
|
||||
$projectType = ProjectTypeSet::where('id',$data['project_type'])->findOrEmpty();
|
||||
$data = Project::findOrEmpty($params['id']);
|
||||
$org = Orgs::field('name')->where('id',$data['org_id'])->findOrEmpty();
|
||||
$dept = Dept::field('name')->where('id',$data['dept_id'])->findOrEmpty();
|
||||
$projectType = ProjectTypeSet::field('name')->where('id',$data['project_type'])->findOrEmpty();
|
||||
$custom = Custom::field('name')->where('id',$data['custom_id'])->findOrEmpty();
|
||||
$data['custom_name'] = $custom->isEmpty() ? '' : $custom['name'];
|
||||
$data['project_type_name'] = $projectType->isEmpty() ? '' : $projectType['name'];
|
||||
return $data;
|
||||
$data['org_name'] = $org['name'];
|
||||
$data['dept_name'] = $dept['name'];
|
||||
$data['custom_name'] = $custom['name'];
|
||||
$data['project_type_name'] = $projectType['name'];
|
||||
$data['status_text'] = $data->status_text;
|
||||
$data['project_content_text'] = $data->project_content_text;
|
||||
$data['bidding_method_text'] = $data->bidding_method_text;
|
||||
$data['relationship_text'] = $data->relationship_text;
|
||||
$data['information_sources_text'] = $data->information_sources_text;
|
||||
$data['construction_funds_sources_text'] = $data->construction_funds_sources_text;
|
||||
$data['construction_financial_status_text'] = $data->construction_financial_status_text;
|
||||
$data['construction_recognition_text'] = $data->construction_recognition_text;
|
||||
$data['my_construction_recognition_text'] = $data->my_construction_recognition_text;
|
||||
$data['strategic_significance_text'] = $data->strategic_significance_text;
|
||||
$data['industry_text'] = $data->industry_text;
|
||||
$data['unit_nature_text'] = $data->unit_nature_text;
|
||||
return $data->toArray();
|
||||
}
|
||||
}
|
@ -39,7 +39,7 @@ class ProjectPreSalesMembersLogic extends BaseLogic
|
||||
* @author likeadmin
|
||||
* @date 2023/11/14 10:15
|
||||
*/
|
||||
public static function add(array $params,$adminId = 0): bool
|
||||
public static function add(array $params,$admin_id): bool
|
||||
{
|
||||
Db::startTrans();
|
||||
try {
|
||||
@ -48,7 +48,7 @@ class ProjectPreSalesMembersLogic extends BaseLogic
|
||||
'technician_ids' => trim($params['technician_ids'],','),
|
||||
'business_people_ids' => trim($params['business_people_ids'],','),
|
||||
'cross_departmental_personnel_ids' => trim($params['cross_departmental_personnel_ids'],','),
|
||||
'add_people' => $adminId
|
||||
'add_user' => $admin_id
|
||||
]);
|
||||
Db::commit();
|
||||
return true;
|
||||
@ -76,6 +76,7 @@ class ProjectPreSalesMembersLogic extends BaseLogic
|
||||
'technician_ids' => trim($params['technician_ids'],','),
|
||||
'business_people_ids' => trim($params['business_people_ids'],','),
|
||||
'cross_departmental_personnel_ids' => trim($params['cross_departmental_personnel_ids'],','),
|
||||
'update_time' => time()
|
||||
]);
|
||||
Db::commit();
|
||||
return true;
|
||||
@ -109,19 +110,19 @@ class ProjectPreSalesMembersLogic extends BaseLogic
|
||||
*/
|
||||
public static function detail($params): array
|
||||
{
|
||||
$data = ProjectPreSalesMembers::field('id,project_id,technician_ids,business_people_ids,cross_departmental_personnel_ids,add_people,create_time')->findOrEmpty($params['id'])->toArray();
|
||||
$data = ProjectPreSalesMembers::field('id,project_id,technician_ids,business_people_ids,cross_departmental_personnel_ids,add_user,create_time')->findOrEmpty($params['id'])->toArray();
|
||||
$project = Project::field('id,custom_id,name')->where('id',$data['project_id'])->findOrEmpty();
|
||||
$custom = Custom::field('id,name')->where('id',$project['custom_id'])->findOrEmpty();
|
||||
$technician = Admin::where('id','in',$data['technician_ids'])->column('name');
|
||||
$business_people = Admin::where('id','in',$data['business_people_ids'])->column('name');
|
||||
$cross_departmental_personnel = Admin::where('id','in',$data['cross_departmental_personnel_ids'])->column('name');
|
||||
$add_people = Admin::field('name')->where('id',$data['add_people'])->findOrEmpty();
|
||||
$add_user = Admin::field('name')->where('id',$data['add_user'])->findOrEmpty();
|
||||
$data['project_name'] = $project['name'];
|
||||
$data['custom_name'] = $custom['name'];
|
||||
$data['technician'] = implode(',',$technician);
|
||||
$data['business_people'] = implode(',',$business_people);
|
||||
$data['cross_departmental_personnel'] = implode(',',$cross_departmental_personnel);
|
||||
$data['add_people'] = $add_people['name'];
|
||||
$data['add_user_name'] = $add_user['name'];
|
||||
return $data;
|
||||
}
|
||||
}
|
@ -17,6 +17,7 @@ namespace app\adminapi\validate\custom;
|
||||
|
||||
use app\common\model\dept\Dept;
|
||||
use app\common\model\dept\Orgs;
|
||||
use app\common\model\dict\DictData;
|
||||
use app\common\model\project\Project;
|
||||
use app\common\validate\BaseValidate;
|
||||
|
||||
@ -39,8 +40,9 @@ class CustomerDemandValidate extends BaseValidate
|
||||
'dept_id' => 'require|checkDept',
|
||||
'project_id' => 'require|checkProject',
|
||||
'theme' => 'require',
|
||||
'importance' => 'integer|in:1,2,3,4',
|
||||
'recording_time' => 'date',
|
||||
'importance' => 'require|checkImportance',
|
||||
'recording_time' => 'require|dateFormat:Y-m-d',
|
||||
'annex' => 'checkAnnex'
|
||||
];
|
||||
|
||||
protected $message = [
|
||||
@ -49,21 +51,11 @@ class CustomerDemandValidate extends BaseValidate
|
||||
'dept_id.require' => '请选择部门',
|
||||
'project_id.require' => '请选择项目',
|
||||
'theme.require' => '请填写需求主题',
|
||||
'importance.integer' => '重要程度数据格式错误',
|
||||
'importance.in' => '重要程度数据值错误',
|
||||
'recording_time.date' => '记录时间数据格式错误',
|
||||
'importance.require' => '请选择重要程度',
|
||||
'recording_time.require' => '请选择记录时间',
|
||||
'recording_time.dateFormat' => '记录时间数据格式错误',
|
||||
];
|
||||
|
||||
|
||||
/**
|
||||
* 参数描述
|
||||
* @var string[]
|
||||
*/
|
||||
protected $field = [
|
||||
'id' => 'id',
|
||||
];
|
||||
|
||||
|
||||
/**
|
||||
* @notes 添加场景
|
||||
* @return CustomerDemandValidate
|
||||
@ -83,8 +75,7 @@ class CustomerDemandValidate extends BaseValidate
|
||||
* @date 2023/11/24 21:18
|
||||
*/
|
||||
public function sceneEdit()
|
||||
{
|
||||
}
|
||||
{}
|
||||
|
||||
|
||||
/**
|
||||
@ -140,4 +131,24 @@ class CustomerDemandValidate extends BaseValidate
|
||||
return true;
|
||||
}
|
||||
|
||||
public function checkImportance($value): bool|string
|
||||
{
|
||||
$dictData = DictData::where('type_value','importance')->column('value');
|
||||
if(!in_array($value,$dictData)){
|
||||
return '类型无效';
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function checkAnnex($value): bool|string
|
||||
{
|
||||
if(!empty($value) && $value != ''){
|
||||
$annex = json_decode($value,true);
|
||||
if(empty($annex) || !is_array($annex)){
|
||||
return '附件格式错误';
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
@ -37,12 +37,13 @@ class ProjectFollowUpValidate extends BaseValidate
|
||||
'id' => 'require',
|
||||
'project_id' => 'require|checkProject',
|
||||
'theme' => 'require',
|
||||
'follow_date' => 'require|date',
|
||||
'follow_date' => 'require|dateFormat:Y-m-d',
|
||||
'follow_type' => 'require|checkType',
|
||||
'project_assurance' => 'require|checkAssurance',
|
||||
'follow_status' => 'require|checkStatus',
|
||||
'follow_stage' => 'require|checkStage',
|
||||
'next_follow_up_date' => 'date|checkDate'
|
||||
'next_follow_up_date' => 'date|dateFormat:Y-m-d|checkNextFollowUpDate',
|
||||
'file' => 'checkFile',
|
||||
];
|
||||
|
||||
protected $message = [
|
||||
@ -50,23 +51,14 @@ class ProjectFollowUpValidate extends BaseValidate
|
||||
'project_id.require' => '请选择项目',
|
||||
'theme.require' => '请填写主题',
|
||||
'follow_date.require' => '请选择日期',
|
||||
'follow_date.date' => '日期格式错误',
|
||||
'follow_date.dateFormat' => '日期格式错误',
|
||||
'follow_type.require' => '请选择类型',
|
||||
'project_assurance.require' => '请选择项目把握度',
|
||||
'follow_status.require' => '请选择状态',
|
||||
'follow_stage.require' => '请选择阶段',
|
||||
'next_follow_up_date.date' => '下次回访日期格式错误'
|
||||
'next_follow_up_date.dateFormat' => '下次回访日期格式错误'
|
||||
];
|
||||
|
||||
/**
|
||||
* 参数描述
|
||||
* @var string[]
|
||||
*/
|
||||
protected $field = [
|
||||
'id' => 'id',
|
||||
];
|
||||
|
||||
|
||||
/**
|
||||
* @notes 添加场景
|
||||
* @return ProjectFollowUpValidate
|
||||
@ -86,9 +78,7 @@ class ProjectFollowUpValidate extends BaseValidate
|
||||
* @date 2023/11/14 10:49
|
||||
*/
|
||||
public function sceneEdit()
|
||||
{
|
||||
|
||||
}
|
||||
{}
|
||||
|
||||
|
||||
/**
|
||||
@ -155,9 +145,23 @@ class ProjectFollowUpValidate extends BaseValidate
|
||||
return true;
|
||||
}
|
||||
|
||||
public function checkDate($value,$rule,$data) {
|
||||
if(strtotime($value) < strtotime($data['follow_date'])){
|
||||
return '下次回访日期不能小于项目跟进日期';
|
||||
public function checkNextFollowUpDate($value,$rule,$data): bool|string
|
||||
{
|
||||
if(!empty($value)){
|
||||
if(strtotime($value) < strtotime($data['follow_date'])){
|
||||
return '下次回访日期不能小于项目跟进日期';
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function checkFile($value): bool|string
|
||||
{
|
||||
if(!empty($value) && $value != ''){
|
||||
$annex = json_decode($value,true);
|
||||
if(empty($annex) || !is_array($annex)){
|
||||
return '附件格式错误';
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
@ -15,6 +15,11 @@
|
||||
namespace app\adminapi\validate\project;
|
||||
|
||||
|
||||
use app\common\model\custom\Custom;
|
||||
use app\common\model\dept\Dept;
|
||||
use app\common\model\dept\Orgs;
|
||||
use app\common\model\dict\DictData;
|
||||
use app\common\model\project\ProjectTypeSet;
|
||||
use app\common\validate\BaseValidate;
|
||||
|
||||
|
||||
@ -32,35 +37,37 @@ class ProjectValidate extends BaseValidate
|
||||
*/
|
||||
protected $rule = [
|
||||
'id' => 'require',
|
||||
'custom_id' => 'require|integer',
|
||||
'project_type' => 'require|integer',
|
||||
'org_id' => 'require|checkOrg',
|
||||
'dept_id' => 'require|checkDept',
|
||||
'custom_id' => 'require|checkCustom',
|
||||
'project_type' => 'require|checkProjectType',
|
||||
'name' => 'require',
|
||||
'discovery_time' => 'require',
|
||||
'information_sources' => 'require|integer'
|
||||
'project_content' => 'checkProjectContent',
|
||||
'bidding_time' => 'dateFormat:Y-m-d',
|
||||
'bidding_method' => 'checkBidMethod',
|
||||
'relationship' => 'checkRelationship',
|
||||
'discovery_time' => 'require|dateFormat:Y-m-d',
|
||||
'information_sources' => 'require|checkInfoSource',
|
||||
'construction_funds_sources' => 'checkFundSource',
|
||||
'construction_financial_status' => 'checkFinancialStatus',
|
||||
'construction_recognition' => 'checkConstructionRecognition',
|
||||
'my_construction_recognition' => 'checkMyConstructionRecognition',
|
||||
'strategic_significance' => 'checkStrategicSignificance',
|
||||
'industry' => 'checkIndustry',
|
||||
'unit_nature' => 'checkUnitNature',
|
||||
'annex' => 'checkAnnex',
|
||||
];
|
||||
|
||||
protected $message = [
|
||||
'id.require' => '缺少数据主键',
|
||||
'id.require' => '缺少必要参数',
|
||||
'custom_id.require' => '请选择客户',
|
||||
'custom_id.integer' => '客户数据格式错误',
|
||||
'project_type.require' => '请选择工程类型',
|
||||
'project_type.integer' => '工程类型据格式错误',
|
||||
'name.require' => '请填写工程名称',
|
||||
'discovery_time.require' => '请选择发现时间',
|
||||
'information_sources.require' => '请选择信息来源',
|
||||
'information_sources.integer' => '信息来源据格式错误',
|
||||
];
|
||||
|
||||
|
||||
/**
|
||||
* 参数描述
|
||||
* @var string[]
|
||||
*/
|
||||
protected $field = [
|
||||
'id' => 'id',
|
||||
];
|
||||
|
||||
|
||||
/**
|
||||
* @notes 添加场景
|
||||
* @return ProjectValidate
|
||||
@ -80,9 +87,7 @@ class ProjectValidate extends BaseValidate
|
||||
* @date 2023/11/12 14:30
|
||||
*/
|
||||
public function sceneEdit()
|
||||
{
|
||||
return $this->append(['id']);
|
||||
}
|
||||
{}
|
||||
|
||||
|
||||
/**
|
||||
@ -108,4 +113,153 @@ class ProjectValidate extends BaseValidate
|
||||
return $this->only(['id']);
|
||||
}
|
||||
|
||||
public function checkOrg($value): bool|string
|
||||
{
|
||||
$org = Orgs::where('id',$value)->findOrEmpty();
|
||||
if($org->isEmpty()){
|
||||
return '组织不存在';
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function checkDept($value,$rule,$data): bool|string
|
||||
{
|
||||
$dept = Dept::where('id',$value)->findOrEmpty();
|
||||
if($dept->isEmpty()){
|
||||
return '部门不存在';
|
||||
}
|
||||
if($dept['org_id'] != $data['org_id']){
|
||||
return '部门无效';
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function checkCustom($value): bool|string
|
||||
{
|
||||
$custom = Custom::where('id',$value)->findOrEmpty();
|
||||
if($custom->isEmpty()){
|
||||
return '客户不存在';
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function checkProjectType($value): bool|string
|
||||
{
|
||||
$project_type = ProjectTypeSet::where('id',$value)->findOrEmpty();
|
||||
if($project_type->isEmpty()){
|
||||
return '项目类型不存在';
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function checkProjectContent($value): bool|string
|
||||
{
|
||||
$dictData = DictData::where('type_value','project_content')->column('value');
|
||||
if(!in_array($value,$dictData)){
|
||||
return '项目内容无效';
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function checkBidMethod($value): bool|string
|
||||
{
|
||||
$dictData = DictData::where('type_value','bidding_method')->column('value');
|
||||
if(!in_array($value,$dictData)){
|
||||
return '招标方式无效';
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function checkRelationship($value): bool|string
|
||||
{
|
||||
$dictData = DictData::where('type_value','relationship')->column('value');
|
||||
if(!in_array($value,$dictData)){
|
||||
return '关系度无效';
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function checkInfoSource($value): bool|string
|
||||
{
|
||||
$dictData = DictData::where('type_value','information_sources')->column('value');
|
||||
if(!in_array($value,$dictData)){
|
||||
return '信息来源无效';
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function checkFundSource($value): bool|string
|
||||
{
|
||||
$dictData = DictData::where('type_value','construction_funds_sources')->column('value');
|
||||
if(!in_array($value,$dictData)){
|
||||
return '项目建设资金来源无效';
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function checkFinancialStatus($value): bool|string
|
||||
{
|
||||
$dictData = DictData::where('type_value','construction_financial_status')->column('value');
|
||||
if(!in_array($value,$dictData)){
|
||||
return '建设方财务状况无效';
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function checkConstructionRecognition($value): bool|string
|
||||
{
|
||||
$dictData = DictData::where('type_value','construction_recognition')->column('value');
|
||||
if(!in_array($value,$dictData)){
|
||||
return '建设方对我方认可度无效';
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function checkMyConstructionRecognition($value): bool|string
|
||||
{
|
||||
$dictData = DictData::where('type_value','my_construction_recognition')->column('value');
|
||||
if(!in_array($value,$dictData)){
|
||||
return '我方对建设方认可度无效';
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function checkStrategicSignificance($value): bool|string
|
||||
{
|
||||
$dictData = DictData::where('type_value','strategic_significance')->column('value');
|
||||
if(!in_array($value,$dictData)){
|
||||
return '战略意义无效';
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function checkIndustry($value): bool|string
|
||||
{
|
||||
$dictData = DictData::where('type_value','industry')->column('value');
|
||||
if(!in_array($value,$dictData)){
|
||||
return '所属行业无效';
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function checkUnitNature($value): bool|string
|
||||
{
|
||||
$dictData = DictData::where('type_value','unit_nature')->column('value');
|
||||
if(!in_array($value,$dictData)){
|
||||
return '单位性质无效';
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function checkAnnex($value): bool|string
|
||||
{
|
||||
if(!empty($value) && $value != ''){
|
||||
$annex = json_decode($value,true);
|
||||
if(empty($annex) || !is_array($annex)){
|
||||
return '附件格式错误';
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
@ -16,6 +16,7 @@ namespace app\common\model\custom;
|
||||
|
||||
|
||||
use app\common\model\BaseModel;
|
||||
use app\common\model\dict\DictData;
|
||||
use think\model\concern\SoftDelete;
|
||||
|
||||
|
||||
@ -32,7 +33,17 @@ class CustomerDemand extends BaseModel
|
||||
|
||||
public function getImportanceTextAttr($value,$data): string
|
||||
{
|
||||
$res = [1=>'非常重要',2=>'重要',3=>'一般',4=>'不重要'];
|
||||
return $res[$data['importance']];
|
||||
$dictData = DictData::where('type_value','importance')->column('name','value');
|
||||
return $dictData[$data['importance']];
|
||||
}
|
||||
|
||||
public function getRecordingTimeAttr($value): string
|
||||
{
|
||||
return empty($value) ? '' : date('Y-m-d', $value);
|
||||
}
|
||||
|
||||
public function getAnnexAttr($value)
|
||||
{
|
||||
return empty($value) ? null : json_decode($value,true);
|
||||
}
|
||||
}
|
@ -31,29 +31,90 @@ class Project extends BaseModel
|
||||
protected $name = 'project';
|
||||
protected $deleteTime = 'delete_time';
|
||||
|
||||
public function getStatusAttr($value)
|
||||
public function getStatusTextAttr($value,$data)
|
||||
{
|
||||
$project_status = DictData::field('name,value')->where('type_id',39)->select();
|
||||
$status = [];
|
||||
foreach ($project_status as $v) {
|
||||
$status[$v['value']] = $v['name'];
|
||||
}
|
||||
return $status[$value];
|
||||
$dictData = DictData::where('type_value','project_status')->column('name','value');
|
||||
return $dictData[$data['status']];
|
||||
}
|
||||
|
||||
public function getBiddingTimeAttr($value)
|
||||
{
|
||||
return empty($value) ? '' : date('Y-m-d H:i:s', $value);
|
||||
}
|
||||
|
||||
public function getDiscoveryTimeAttr($value)
|
||||
{
|
||||
return empty($value) ? '' : date('Y-m-d H:i:s', $value);
|
||||
}
|
||||
|
||||
public function custom()
|
||||
public function getProjectContentTextAttr($value,$data)
|
||||
{
|
||||
return $this->belongsTo(\app\common\model\custom\Custom::class, 'custom_id');
|
||||
$dictData = DictData::where('type_value','project_content')->column('name','value');
|
||||
return $dictData[$data['project_content']];
|
||||
}
|
||||
|
||||
public function getBiddingMethodTextAttr($value,$data)
|
||||
{
|
||||
$dictData = DictData::where('type_value','bidding_method')->column('name','value');
|
||||
return $dictData[$data['bidding_method']];
|
||||
}
|
||||
|
||||
public function getRelationshipTextAttr($value,$data)
|
||||
{
|
||||
$dictData = DictData::where('type_value','relationship')->column('name','value');
|
||||
return $dictData[$data['relationship']];
|
||||
}
|
||||
|
||||
public function getInformationSourcesTextAttr($value,$data)
|
||||
{
|
||||
$dictData = DictData::where('type_value','information_sources')->column('name','value');
|
||||
return $dictData[$data['information_sources']];
|
||||
}
|
||||
|
||||
public function getConstructionFundsSourcesTextAttr($value,$data)
|
||||
{
|
||||
$dictData = DictData::where('type_value','construction_funds_sources')->column('name','value');
|
||||
return $dictData[$data['construction_funds_sources']];
|
||||
}
|
||||
|
||||
public function getConstructionFinancialStatusTextAttr($value,$data)
|
||||
{
|
||||
$dictData = DictData::where('type_value','construction_financial_status')->column('name','value');
|
||||
return $dictData[$data['construction_financial_status']];
|
||||
}
|
||||
|
||||
public function getConstructionRecognitionTextAttr($value,$data)
|
||||
{
|
||||
$dictData = DictData::where('type_value','construction_recognition')->column('name','value');
|
||||
return $dictData[$data['construction_recognition']];
|
||||
}
|
||||
|
||||
public function getMyConstructionRecognitionTextAttr($value,$data)
|
||||
{
|
||||
$dictData = DictData::where('type_value','my_construction_recognition')->column('name','value');
|
||||
return $dictData[$data['my_construction_recognition']];
|
||||
}
|
||||
|
||||
public function getStrategicSignificanceTextAttr($value,$data)
|
||||
{
|
||||
$dictData = DictData::where('type_value','strategic_significance')->column('name','value');
|
||||
return $dictData[$data['strategic_significance']];
|
||||
}
|
||||
|
||||
public function getIndustryTextAttr($value,$data)
|
||||
{
|
||||
$dictData = DictData::where('type_value','industry')->column('name','value');
|
||||
return $dictData[$data['industry']];
|
||||
}
|
||||
|
||||
public function getUnitNatureTextAttr($value,$data)
|
||||
{
|
||||
$dictData = DictData::where('type_value','unit_nature')->column('name','value');
|
||||
return $dictData[$data['unit_nature']];
|
||||
}
|
||||
|
||||
public function getBiddingTimeAttr($value): string
|
||||
{
|
||||
return empty($value) ? '' : date('Y-m-d', $value);
|
||||
}
|
||||
|
||||
public function getDiscoveryTimeAttr($value): string
|
||||
{
|
||||
return empty($value) ? '' : date('Y-m-d', $value);
|
||||
}
|
||||
|
||||
public function getAnnexAttr($value)
|
||||
{
|
||||
return empty($value) ? null : json_decode($value,true);
|
||||
}
|
||||
}
|
@ -55,6 +55,16 @@ class ProjectFollowUp extends BaseModel
|
||||
return $dictData[$data['follow_stage']];
|
||||
}
|
||||
|
||||
public function getFollowDateAttr($value): string
|
||||
{
|
||||
return !empty($value) ? date('Y-m-d',$value) : '';
|
||||
}
|
||||
|
||||
public function getNextFollowUpDateAttr($value): string
|
||||
{
|
||||
return !empty($value) ? date('Y-m-d',$value) : '';
|
||||
}
|
||||
|
||||
public function getFileAttr($value)
|
||||
{
|
||||
return !empty($value) ? json_decode($value) : null;
|
||||
|
Loading…
x
Reference in New Issue
Block a user