Commit 303bb77f authored by clone's avatar clone

1

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