|
@@ -4,6 +4,7 @@ namespace App\Service;
|
|
|
|
|
|
|
|
|
use App\Model\BasicType;
|
|
|
+use App\Model\Customer;
|
|
|
use App\Model\Employee;
|
|
|
use App\Model\FollowUpRecord;
|
|
|
use App\Model\FollowUpRecordFile;
|
|
@@ -123,6 +124,9 @@ class OperationLogService extends Service
|
|
|
// ]
|
|
|
// ]
|
|
|
// ];
|
|
|
+
|
|
|
+ $array = [];
|
|
|
+ if (strpos($data['order_number'], '|') !== false) $array = explode('|',$data['order_number']);
|
|
|
|
|
|
//按钮类功能的操作日志
|
|
|
$log_list2 = OrderOperation::where('del_time',0)
|
|
@@ -133,15 +137,28 @@ class OperationLogService extends Service
|
|
|
$log_list2[$key]['type'] = 4; //操作类
|
|
|
$log_list2[$key]['crt_time'] = $value['crt_time'] ? date('Y-m-d H:i:s', $value['crt_time']) : "";
|
|
|
$log_list2[$key]['user_name'] = $employee_key_list[$value['user_id']] ?? "";
|
|
|
+ if(! empty($array[2])) $log_list2[$key]['order_number'] = $array[2];
|
|
|
}
|
|
|
|
|
|
$list_final = array_merge($log_list, $log_list2);
|
|
|
|
|
|
//跟进日志
|
|
|
- $log_list3 = FollowUpRecord::where('del_time',0)
|
|
|
- ->where('data_title',$data['order_number'])
|
|
|
- ->select('id','data_title as order_number','basic_type_id','visit_time','content','crt_id as user_id','result','crt_time')
|
|
|
- ->get()->toArray();
|
|
|
+ $log_list3 = [];
|
|
|
+ if(! empty($array[0]) && ! empty($array[1])){
|
|
|
+ if($array[0] == Customer::$order_number){
|
|
|
+ $log_list3 = FollowUpRecord::where('del_time',0)
|
|
|
+ ->where('type', FollowUpRecord::type_one)
|
|
|
+ ->where('data_id',$array[1])
|
|
|
+ ->select('id','data_title as order_number','basic_type_id','visit_time','content','crt_id as user_id','result','crt_time')
|
|
|
+ ->get()->toArray();
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ $log_list3 = FollowUpRecord::where('del_time',0)
|
|
|
+ ->where('data_title',$data['order_number'])
|
|
|
+ ->select('id','data_title as order_number','basic_type_id','visit_time','content','crt_id as user_id','result','crt_time')
|
|
|
+ ->get()->toArray();
|
|
|
+ }
|
|
|
+
|
|
|
$basic_type_map = BasicType::whereIn('id',array_unique(array_column($log_list3,'basic_type_id')))->pluck('title','id')->toArray();
|
|
|
$log_list3_detail = FollowUpRecordFile::where('del_time',0)
|
|
|
->whereIn('follow_up_record_id',array_column($log_list3,'id'))
|
|
@@ -170,9 +187,6 @@ class OperationLogService extends Service
|
|
|
return [true, $list_final];
|
|
|
}
|
|
|
|
|
|
-// public function
|
|
|
-
|
|
|
-
|
|
|
public function setOperationList($data, $user, $type = 1, $menu_id = 18)
|
|
|
{
|
|
|
|