Commit 303bb77f authored by clone's avatar clone

1

parent d692de33
<?php <?php
namespace app\index\controller; namespace app\index\controller;
use app\index\extend\Basic; use app\index\extend\Basic;
use app\index\service\OfficeUserLogService; use app\index\service\OfficeUserLogService;
use app\index\service\UserLogService; use app\index\service\UserLogService;
...@@ -12,8 +14,8 @@ use think\Request; ...@@ -12,8 +14,8 @@ use think\Request;
* Time : 2:23 PM * Time : 2:23 PM
* Intro: * Intro:
*/ */
class UserLog extends Basic
class UserLog extends Basic{ {
private $service_; private $service_;
private $OfficeUserLogService; private $OfficeUserLogService;
...@@ -21,7 +23,7 @@ class UserLog extends Basic{ ...@@ -21,7 +23,7 @@ class UserLog extends Basic{
public function __construct(Request $request = null) public function __construct(Request $request = null)
{ {
parent::__construct($request); parent::__construct($request);
$this->service_ = new UserLogService(); $this->service_ = new UserLogService();
$this->OfficeUserLogService = new OfficeUserLogService(); $this->OfficeUserLogService = new OfficeUserLogService();
} }
...@@ -48,11 +50,11 @@ class UserLog extends Basic{ ...@@ -48,11 +50,11 @@ class UserLog extends Basic{
} }
$user_id = $params['user_id']; $user_id = $params['user_id'];
$agent_id = $params['agent_id']; $agent_id = $params['agent_id'];
$result = $this->service_->userDetail($user_id,$agent_id, $this->siteId); $result = $this->service_->userDetail($user_id, $agent_id, $this->siteId);
if($result["code"] == 200){ if ($result["code"] == 200) {
return $this->response("200", "success!", $result["data"]); return $this->response("200", "success!", $result["data"]);
}else{ } else {
return $this->response("101", $result["msg"]); return $this->response("101", $result["msg"]);
} }
...@@ -66,12 +68,14 @@ class UserLog extends Basic{ ...@@ -66,12 +68,14 @@ class UserLog extends Basic{
* @throws \think\db\exception\ModelNotFoundException * @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException * @throws \think\exception\DbException
*/ */
public function userLog(){ public function userLog()
{
$params = $this->params; $params = $this->params;
/* $params = array( /* $params = array(
"user_id" => 828, "user_id" => 828,
"type" => 1, "type" => 1,
"site_id" => 10001,
);*/ );*/
$checkResult = $this->validate($params, "UserLogValidate.userLog"); $checkResult = $this->validate($params, "UserLogValidate.userLog");
...@@ -79,18 +83,19 @@ class UserLog extends Basic{ ...@@ -79,18 +83,19 @@ class UserLog extends Basic{
return $this->response(101, $checkResult); return $this->response(101, $checkResult);
} }
$user_id = $params['user_id']; $user_id = $params['user_id'];
$type = $params['type']; $site_id = $params['site_id'];
$type = $params['type'];
if($params['entrust_type'] == 1){ if ($params['entrust_type'] == 1) {
$result = $this->OfficeUserLogService->userLog($user_id,$this->siteId,$type); $result = $this->OfficeUserLogService->userLog($user_id, $site_id, $type);
}else{ } else {
$result = $this->service_->userLog($user_id,$this->siteId,$type); $result = $this->service_->userLog($user_id, $site_id, $type);
} }
if(count($result) > 0){ if (count($result) > 0) {
return $this->response("200", "success!", $result); return $this->response("200", "success!", $result);
}else{ } else {
return $this->response("101", "请求数据为空"); return $this->response("101", "请求数据为空");
} }
...@@ -100,12 +105,14 @@ class UserLog extends Basic{ ...@@ -100,12 +105,14 @@ class UserLog extends Basic{
* 电话跟进 * 电话跟进
* @return \think\Response * @return \think\Response
*/ */
public function followUpLogNew(){ public function followUpLogNew()
{
$params = $this->params; $params = $this->params;
/* $params = array( /* $params = array(
"user_id" => 828, "user_id" => 828,
"page_no" => 1, "page_no" => 1,
"site_id" => 10001,
"page_size" => 15 "page_size" => 15
);*/ );*/
$checkResult = $this->validate($params, "UserLogValidate.followUpLog"); $checkResult = $this->validate($params, "UserLogValidate.followUpLog");
...@@ -114,18 +121,19 @@ class UserLog extends Basic{ ...@@ -114,18 +121,19 @@ class UserLog extends Basic{
} }
$user_id = $params['user_id']; $user_id = $params['user_id'];
$site_id = $params['site_id'];
$pageNo = empty($params['page_no']) ? 1 : $params['page_no']; $pageNo = empty($params['page_no']) ? 1 : $params['page_no'];
$pageSize = empty($params['page_size']) ? 15 : $params['page_size']; $pageSize = empty($params['page_size']) ? 15 : $params['page_size'];
if(isset($params['entrust_type']) && $params['entrust_type'] == 1){ if (isset($params['entrust_type']) && $params['entrust_type'] == 1) {
return $this->response("101", "请求数据空"); return $this->response("101", "请求数据空");
}else{ } else {
$result = $this->service_->phoneFollowUpNew($user_id,$this->siteId,$pageNo,$pageSize); $result = $this->service_->phoneFollowUpNew($user_id, $site_id, $pageNo, $pageSize);
} }
if(count($result) > 0){ if (count($result) > 0) {
return $this->response("200", "success!", $result); return $this->response("200", "success!", $result);
}else{ } else {
return $this->response("101", "请求数据为空"); return $this->response("101", "请求数据为空");
} }
} }
...@@ -134,12 +142,14 @@ class UserLog extends Basic{ ...@@ -134,12 +142,14 @@ class UserLog extends Basic{
* 电话跟进 * 电话跟进
* @return \think\Response * @return \think\Response
*/ */
public function followUpLog(){ public function followUpLog()
{
$params = $this->params; $params = $this->params;
/* $params = array( /* $params = array(
"user_id" => 828, "user_id" => 828,
"page_no" => 1, "page_no" => 1,
"site_id" => 10001,
"page_size" => 15 "page_size" => 15
);*/ );*/
$checkResult = $this->validate($params, "UserLogValidate.followUpLog"); $checkResult = $this->validate($params, "UserLogValidate.followUpLog");
...@@ -148,18 +158,19 @@ class UserLog extends Basic{ ...@@ -148,18 +158,19 @@ class UserLog extends Basic{
} }
$user_id = $params['user_id']; $user_id = $params['user_id'];
$site_id = $params['site_id'];
$pageNo = empty($params['page_no']) ? 1 : $params['page_no']; $pageNo = empty($params['page_no']) ? 1 : $params['page_no'];
$pageSize = empty($params['page_size']) ? 15 : $params['page_size']; $pageSize = empty($params['page_size']) ? 15 : $params['page_size'];
if(isset($params['entrust_type']) && $params['entrust_type'] == 1){ if (isset($params['entrust_type']) && $params['entrust_type'] == 1) {
$result = $this->OfficeUserLogService->phoneFollowUp($user_id,$this->siteId,$pageNo,$pageSize); $result = $this->OfficeUserLogService->phoneFollowUp($user_id, $site_id, $pageNo, $pageSize);
}else{ } else {
$result = $this->service_->phoneFollowUp($user_id,$this->siteId,$pageNo,$pageSize); $result = $this->service_->phoneFollowUp($user_id, $site_id, $pageNo, $pageSize);
} }
if(count($result) > 0){ if (count($result) > 0) {
return $this->response("200", "success!", $result); return $this->response("200", "success!", $result);
}else{ } else {
return $this->response("101", "请求数据为空"); return $this->response("101", "请求数据为空");
} }
} }
......
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