Commit 92637a99 authored by clone's avatar clone

Merge branch '0806-v2.6.0' into test-0806-bug

# Conflicts: # application/index/controller/CellPhone.php
parents 5c8bf6e9 6d2f76ca
......@@ -138,4 +138,56 @@ class User extends Basic
return $this->response("200", 'request success', $data);
}
/**
* 客户详情上一页下一页接口
* @return \think\Response
* 朱伟 2018-08-07
*/
public function getLastOrNextUserID()
{
header('Access-Control-Allow-Origin:*');
$params = $this->params;
/*$params = array(
"user_id" => 3,
"agent_id" => 9,
"type" =>"last",
);*/
$checkResult = $this->validate($params, "UserGetLastOrNextUserIdValidate.verifyStatus");
if (true !== $checkResult) {
return $this->response("300", $checkResult);
}
//todo 判断是 杭州还是上海
$where['city'] = '上海市';
if ($params['type'] == 'last'){
$where['id'] = ['gt',$params['user_id']];
}else{
$where['id'] = ['lt',$params['user_id']];
}
//dump($where);
$field = 'id,user_nick,agent_id,vip';
$user = new Users();
$user_res = $user->getLastOrNextUserID($where,$field,$limit=1);
//todo 判断是否vip客户,如果是 只有是当前经纪人自己的客户才能查看
//vip客户 0:否 1:是
if(($user_res['vip'] == 1) && ($user_res['agent_id'] != $params['agent_id'])){
return $this->response("200", "不符合条件", []);
}
//todo 判断
$clientService = new ClientService();
if($clientService->dialTotal($params['user_id'])){
return $this->response("200", "不符合条件!", []);
}
$where = [];
$where['city'] = '上海市';
$field = 'max(id) as max_id';
$max_id = $user->getLastOrNextUserID($where,$field,$limit='');
return $this->response("200", "success!", ['user_id'=>$user_res[0]['id'],'max_user_id'=>$max_id[0]['max_id']]);
}
}
\ No newline at end of file
<?php
namespace app\api_broker\validate;
use think\Validate;
/**
* Created by PhpStorm.
* User: zhuwei
* Date: 2018/8/7
* Time: 13:54:12
*/
class UserGetLastOrNextUserIdValidate extends Validate{
protected $rule = [
'type' => 'require',
'agent_id' => 'require|number|gt:0',
'user_id' => 'require|number|gt:0'
];
protected $message = [
'type.require' => '网络异常!错误代码:uv1',//type为必填字段
'agent_id.require' => '网络异常!错误代码:uv3',//agent_id为必填字段
'agent_id.number' => '网络异常!错误代码:uv4',//agent_id只能为数字
'agent_id.gt' => '网络异常!错误代码:uv5',//agent_id必须大于0
'user_id.require' => '网络异常!错误代码:uv6',//user_id为必填字段
'user_id.number' => '网络异常!错误代码:uv7',//user_id只能为数字
'user_id.gt' => '网络异常!错误代码:uv8',//user_id必须大于0
];
protected $scene = [
'add_phone_follow_up_verify' => [ 'user_id', 'agent_id', 'type'],
];
}
......@@ -157,8 +157,8 @@
</div>
<script type="text/javascript" src="/app/js/jquery-1122-min.js"></script>
<script src="/app/js/common.js?new41" charset="utf-8"></script>
<script src="/app/js/customerinfo_details_new.js?new48"></script>
<script src="/app/js/common.js?new42" charset="utf-8"></script>
<script src="/app/js/customerinfo_details_new.js?new49"></script>
</body>
......
......@@ -18,19 +18,19 @@
<tbody>
<tr>
<td>商铺编号:{{d.id}}</td>
<td>商铺类型:{{d.shop_type?'街铺':'商场'}}</td>
<td>商铺类型:{{(d.shop_type==1)?'街铺':'商场'}}</td>
<td>是否对客户展示:{{d.is_show?'否':'是'}}</td>
<td>是否独家:{{d.is_exclusive_type?'是':'否'}}</td>
</tr>
<tr>
<td>{{dealPrice}}</td>
<td>{{d.shop_type?'对内转让费':'进场费'}}:{{d.slotting_fee}}元</td>
<td>{{(d.shop_type==1)?'对内转让费':'进场费'}}:{{d.slotting_fee}}元</td>
<td>物业管理费:{{d.management_fee}}元/月</td>
<td></td>
</tr>
<tr>
<td>{{d.shop_type?'使用面积':'商铺面积'}}:{{dealArea}}</td>
<td>{{d.shop_type?'建筑面积':'项目总面积'}}:{{d.market_area}}m²</td>
<td>{{(d.shop_type==1)?'使用面积':'商铺面积'}}:{{dealArea}}</td>
<td>{{(d.shop_type==1)?'建筑面积':'项目总面积'}}:{{d.market_area}}m²</td>
<td>剩余铺数:{{d.residue_num}}</td>
<td>总铺数:{{d.total}}</td>
</tr>
......
......@@ -21,6 +21,37 @@ class Performance extends Basic
$this->service_ = new PerformanceService();
}
public function getSearchTimeType($start_day,$end_day)
{
//todo 1.今天之前,不包括今天
$search_time_type = 1;
if(
(date('Y-m-d',strtotime($start_day)) != date("Y-m-d", time()))
&&
(date('Y-m-d',strtotime($end_day)) != date("Y-m-d", time()))
){
$search_time_type = 1;
}
//todo 2.今天之前,包括今天
if(
(date('Y-m-d',strtotime($start_day)) != date("Y-m-d", time()))
&&
(date('Y-m-d',strtotime($end_day)) == date("Y-m-d", time()))
){
$search_time_type = 2;
}
//todo 3.就只查询今天
if(
(date('Y-m-d',strtotime($start_day)) == date("Y-m-d", time()))
&&
(date('Y-m-d',strtotime($end_day)) == date("Y-m-d", time()))
){
$search_time_type = 3;
}
return $search_time_type;
}
//TODO 区域业绩排行 District
/**
......@@ -40,14 +71,16 @@ class Performance extends Basic
$pageNo = empty($this->params['pageNo']) ? 1 : $this->params['pageNo'];
$pageSize = empty($this->params['pageSize']) ? 15 : $this->params['pageSize'];
//默认排序一周 2018-07-18改为本月
$end_day = !empty($params["end_day"]) ? $params["end_day"] : date("Y-m-d", time());
$start_day = !empty($params["start_day"]) ? $params["start_day"] : date("Y-m-01", time());
$end_day = !empty($params["end_day"]) ? $params["end_day"] : date("Y-m-d", time());
$father_id = !empty($params["father_id"]) ? $params["father_id"] : '' ;
$is_today = !empty($params["is_today"]) ? $params["is_today"] : 0 ;
//todo 业绩查询目前分三种情况
$search_time_type = $this->getSearchTimeType($start_day,$end_day);
$list = $this->service_->totalAgent($params["type"], $end_day, $start_day,$pageNo,$pageSize,$father_id,$is_today);
$list = $this->service_->totalAgent($params["type"], $end_day, $start_day,$pageNo,$pageSize,$father_id,$search_time_type);
//dump($list);
if (count($list) > 0) {
$result["list"] = $list['list'];
......@@ -84,10 +117,11 @@ class Performance extends Basic
$end_day = !empty($params["end_day"]) ? $params["end_day"] : date("Y-m-d", time());
$start_day = !empty($params["start_day"]) ? $params["start_day"] : date("Y-m-01", time());
$father_id = !empty($params["father_id"]) ? $params["father_id"] : '' ;
$is_today = !empty($params["is_today"]) ? $params["is_today"] : 0 ;
//todo 业绩查询目前分三种情况
$search_time_type = $this->getSearchTimeType($start_day,$end_day);
$list = $this->service_->totalAgent($params["type"], $end_day, $start_day,$pageNo,$pageSize,$father_id,$is_today);
$list = $this->service_->totalAgent($params["type"], $end_day, $start_day,$pageNo,$pageSize,$father_id,$search_time_type);
//dump($list);
if (count($list) > 0) {
$result["list"] = $list['list'];
......@@ -126,10 +160,11 @@ class Performance extends Basic
$end_day = !empty($params["end_day"]) ? $params["end_day"] : date("Y-m-d", time());
$start_day = !empty($params["start_day"]) ? $params["start_day"] : date("Y-m-01", time());
$father_id = !empty($params["father_id"]) ? $params["father_id"] : '' ;
$is_today = !empty($params["is_today"]) ? $params["is_today"] : 0 ;
//todo 业绩查询目前分三种情况
$search_time_type = $this->getSearchTimeType($start_day,$end_day);
$list = $this->service_->totalAgent($params["type"], $end_day, $start_day,$pageNo,$pageSize,$father_id,$is_today);
$list = $this->service_->totalAgent($params["type"], $end_day, $start_day,$pageNo,$pageSize,$father_id,$search_time_type);
//dump($list);
if (count($list) > 0) {
$result["list"] = $list['list'];
......
......@@ -235,4 +235,6 @@ class Remark extends Basic
//dump($total);
return $this->response("200", "success!", ['user_date'=>$UPhoneFollowPp_res,'pagenum'=>$pagenum,'total'=>$total]);
}
}
\ No newline at end of file
......@@ -747,5 +747,19 @@ class Users extends Model
return $data;
}
public function getLastOrNextUserID($where,$field,$limit)
{
$return = Db::name($this->table)
->field($field)
->where($where)
->limit($limit)
->order('id asc')
->select();
//dump($this->getLastSql());
return $return;
}
}
......@@ -190,6 +190,7 @@ Route::group('index', [
'useraction_search' => [ 'index/remark/useraction_search', [ 'method' => 'get|post' ] ], //后台客户详情
'select_by_phone' => [ 'index/remark/select_by_phone', [ 'method' => 'get|post' ] ], //后台客户详情--客方搜索
'getSetting' => [ 'index/Setting/getSetting', [ 'method' => 'get|post' ] ], //新增和修改全局参数设置
'getMenu' => [ 'index/Auth/getMenu', [ 'method' => 'get|post' ] ], //新增和修改全局参数设置
'reportListOne/:check_status' => [ 'index/Finance/reportList', [ 'method' => 'get' ], [ 'check_status' => 1 ] ], //财务 成交报告-未结单-第一级审核
......@@ -520,6 +521,8 @@ Route::group('broker', [
//user
'returnSearchCondition' => [ 'api_broker/User/returnSearchCondition', [ 'method' => 'get' ] ], //客户搜索条件
'searchUser' => [ 'api_broker/User/searchUser', [ 'method' => 'get|post' ] ], //客户搜索
'getLastOrNextUserID' => [ 'api_broker/User/getLastOrNextUserID', [ 'method' => 'get|post' ] ], //客户搜索
'superviseListNew' => [ 'api_broker/Supervise/superviseList', [ 'method' => 'POST|GET' ] ], //监督执行列表 朱伟 2018-06-15
'addSupervise' => [ 'api_broker/Supervise/addSupervise', [ 'method' => 'POST|GET' ] ], //新增-监督执行 朱伟 2018-06-20
'superviseUploadImg' => [ 'api_broker/Supervise/superviseUploadImg', [ 'method' => 'POST|GET' ] ], //监督执行-上传图片 朱伟 2018-06-20
......
......@@ -181,6 +181,11 @@ header .icon-link{
height: 100%;
}
/*约带看部分颜色不同*/
.sp-yuedaikan-beizhu-span{
color: #999;
}
/*基本信息部分*/
.sec-info{
font-size: .3rem;
......
......@@ -58,8 +58,7 @@ function loadMain(){
//获取客户基本信息
$.ajax({
type: 'POST',
url: ServerHostTempC + '/broker/useraction_search',
//url: '/broker/useraction_search',
url: '/broker/useraction_search',
data: {
'AuthToken': _token,
'user_id': Number(_customerId),//客户id
......@@ -144,6 +143,13 @@ function loadMain(){
'7': obj['explain_img']?'<ol class="li-img-list"><li><a href="/app_broker/imagebody?fullUrl='+obj['img_path']+obj['explain_img']+'"><img src="'+obj['img_path']+obj['explain_img']+'" /></a></li></ol>':''
});
};
//约带看时的特殊处理
function dealSpYdk(obj){
return '<p>到场时间:{0}</p><p class="sp-yuedaikan-beizhu-span">备注:{1}</p>'.stringFormatObj({
'0': obj['predict_see_time'],
'1': obj['intro']
});
};
var _htmlTemp = '';
if(data['data']['user_date'] && data['data']['user_date'].length > 0){
$.each(data['data']['user_date'], function(i, item) {
......@@ -153,7 +159,7 @@ function loadMain(){
'2': item['step_name']=='phone_fllow_up'?'电话跟进:':(item['step_name']=='fllow_up'?'跟进:':''),
'3': (item['create_time']==null?null:item['create_time']),
'5': item['step'],
'6': item['step_name']=='follow_up_log'?dealSp(item):'',
'6': item['step_name']=='follow_up_log'?dealSp(item):(item['step_name']=='report'?dealSpYdk(item):''),
'7': (item['step_name']=='report' || item['step_name']=='march_in')?'li-sp-active':''
});
});
......
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