Commit 295dd597 authored by zhuwei's avatar zhuwei

带看动态

parent a42687e3
...@@ -833,7 +833,13 @@ class User extends Basic ...@@ -833,7 +833,13 @@ class User extends Basic
} }
$user_id = $params['user_id']; $user_id = $params['user_id'];
$type = $params['type']; $type = $params['type'];
$result = $this->userLogService->userLog($user_id,$this->siteId,$type);
if(isset($params['entrust_type']) && ($params['entrust_type']== 1)){
$result = $this->OfficeUserLogService->userLog($user_id,$this->siteId,$type);
}else{
$result = $this->userLogService->userLog($user_id,$this->siteId,$type);
}
if(count($result) > 0){ if(count($result) > 0){
return $this->response("200", "success!", $result); return $this->response("200", "success!", $result);
......
...@@ -4,6 +4,7 @@ namespace app\index\service; ...@@ -4,6 +4,7 @@ namespace app\index\service;
use app\api_broker\service\CallPhoneService; use app\api_broker\service\CallPhoneService;
use app\api_broker\service\ClientService; use app\api_broker\service\ClientService;
use app\api_broker\service\OfficeOrderLogService;
use app\api_broker\service\OrderLogService; use app\api_broker\service\OrderLogService;
use app\api_broker\service\RedisCacheService; use app\api_broker\service\RedisCacheService;
use app\api_broker\service\VipService; use app\api_broker\service\VipService;
...@@ -33,7 +34,7 @@ class OfficeUserLogService ...@@ -33,7 +34,7 @@ class OfficeUserLogService
{ {
$this->agentModel = new AAgents(); $this->agentModel = new AAgents();
$this->userModel = new Users(); $this->userModel = new Users();
$this->orderService = new OrderLogService(); $this->orderService = new OfficeOrderLogService();
} }
...@@ -86,4 +87,36 @@ class OfficeUserLogService ...@@ -86,4 +87,36 @@ class OfficeUserLogService
} }
/**
* 客户动态
* @param $user_id
* @param $site_id
* @param $type 1表示查最近的一条跟进,2查所有的订单更近
* @return false|mixed|null|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function userLog($user_id, $site_id, $type)
{
$result = $this->orderService->selectListByUserIdAndSiteId($user_id, '', $site_id);
switch ($type){
case 1:
if(count($result) > 0){
return $result[0];
}else{
return null;
}
case 2:
return $result;
default:
return null;
break;
}
}
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment