Commit 14c2778b authored by clone's avatar clone

Merge branch 'test-0814-bug' into test

# Conflicts: # application/index/service/PerformanceService.php
parents de010fbf 2c2e42a5
......@@ -271,13 +271,14 @@ class Broker extends Basic
{
header('Access-Control-Allow-Origin:*');
$params = $this->params;
/*
$params['content']='跟进内容';//跟进内容
/*$params['content']='跟进内容';//跟进内容
$params['labels_id']=1;//g_labels表主键
$params['user_id']=1;//u_users ID用户表id
$params['user_id']=59072;//u_users ID用户表id
$params['agent_id']=1;//agent表id-当前登录用户id
$params['type']='1';//0电话跟进 1普通跟进
*/
$params['user_status']='1';//0电话跟进 1普通跟进*/
$checkResult = $this->validate($params, "BrokerValidate.verifyStatus");
if (true !== $checkResult) {
......@@ -287,11 +288,18 @@ class Broker extends Basic
$user_id = $params['user_id'];
$user_status = $params['user_status'];
$Users = new Users();
$result = $Users->getUserCityInfo($user_id);
if($result){
$params['province'] = $result[0]['province'] ? $result[0]['province'] : '上海市';
$params['city'] = $result[0]['city']? $result[0]['city'] : '上海市';
$params['disc'] = $result[0]['disc']? $result[0]['disc'] : '黄浦区';
}
//主表查询商铺详细信息
$UPhoneFollowPp = new UPhoneFollowPp();
$result = $UPhoneFollowPp->savePhoneFollow($params);
//跟进,对客户状态进行更新 0:求租;1:已租;-1:无效
$Users = new Users();
$Users->update_user_status([ 'id' => $user_id, 'user_status' => $user_status ]);
if ($result == 1) {
......
......@@ -3,6 +3,8 @@
namespace app\api_broker\controller;
use app\api_broker\extend\Basic;
use app\model\AAgents;
use app\model\GHouses;
use app\model\GHousesFollowUp;
use app\model\UPhoneFollowPp;
use think\Request;
......@@ -37,14 +39,14 @@ class HomePageLog extends Basic
public function userFollowUpList()
{
$params = $this->params;
/* $params = array(
"start_time" => time(), //开始时间
"end_time" => time() . " 23:59:59", //结束时间
"name_or_phone" => "li",//用户姓名或电话 经纪人
"search_content" => "111",// 搜索跟进内容
"pageNo" => 1,
"pageSize" => 15
);*/
/*$params = array(
"start_time" => strtotime('2016-08-14 15:47:36'), //开始时间
"end_time" => strtotime('2018-08-14 15:47:36'), //结束时间
"name_or_phone" => "18112347151",//用户姓名或电话 经纪人
"search_content" => "",// 搜索跟进内容
"pageNo" => 1,
"pageSize" => 15
);*/
if (empty($params['start_time']) || empty($params['end_time'])) {
return $this->response("101", '请选择时间');
......@@ -53,7 +55,7 @@ class HomePageLog extends Basic
$pageNo = empty($params['pageNo']) ? 1 : $params['pageNo'];
$pageSize = empty($params['pageSize']) ? 15 : $params['pageSize'];
$field = "f.id,f.user_id,f.agent_id,f.type,f.content,f.create_time,f.user_status,a.name,a.img,b.store_name";
$field = "f.id,f.user_id,f.agent_id,f.type,f.content,f.create_time,f.user_status";
$where_ = [];
if (!empty($params["search_content"])) {
$where_["f.content"] = array( "like", "%" . trim($params['search_content']) . "%" );
......@@ -63,25 +65,44 @@ class HomePageLog extends Basic
$end_time = date("Y-m-d H:i:s", $params["end_time"]);
$where_["f.create_time"] = array( 'between', array( $start_time, $end_time ) );
}
if (!empty($params["name_or_phone"])) {
$where_["a.name|a.phone"] = array( "like", "%" . trim($params["name_or_phone"]) . "%" );
if ((preg_match("/^1\d{10}$/", $params['name_or_phone']) != 1) or (strlen($params['name_or_phone']) < 6)) {
return $this->response("300", '手机号有误或者姓名不满两位汉字');
}
$agent_params["phone|name"] = $params["name_or_phone"];
$agent_field = "id";
$model = new AAgents();
$res_a = $model->getAgentsIdsArray($agent_field, $agent_params);
if ($res_a) {
$where_["f.agent_id"] = [ 'in', $res_a ];
}
}
$where_["u.city"] = trim($this->city);
$where_["f.city"] = trim($this->city) ? trim($this->city) : '上海市';
$join = [
[ 'a_agents a', 'a.id=f.agent_id', 'left' ],
[ 'u_users u', 'u.id=f.user_id', 'left' ],
[ 'a_store b', 'b.id=a.store_id', 'left' ],
];
$order = "f.id desc";
$result = $this->uPhoneFollowUpModel->getSearch($pageNo, $pageSize, $order, $field, $join, $where_, "");
//$count = $this->uPhoneFollowUpModel->getSearchCount($join, $where_);
$order = "f.id desc";
$result = $this->uPhoneFollowUpModel->getSearch($pageNo, $pageSize, $order, $field, [], $where_, "");
foreach ($result as $key => $value) {
$agent_params = [];
$agent_params["a.id"] = $value['agent_id'];
$agent_field = "a.name,a.img,b.store_name";
$model = new AAgents();
$res_a = $model->getAgentsInfo($agent_field, $agent_params);
$result[$key]['name'] = $res_a[0]['name'];
$result[$key]['img'] = $res_a[0]['img'];
$result[$key]['store_name'] = $res_a[0]['store_name'];
}
$count = $this->uPhoneFollowUpModel->getSearchCount($where_);
if (count($result) > 0) {
$list["result"] = $result;
$list["img_path"] = AGENTHEADERIMGURL;
//暂时处理
$list["total"] = 0;
$list["total"] = $count;
return $this->response("200", "request success", $list);
} else {
return $this->response("200", "request null");
......@@ -100,15 +121,15 @@ class HomePageLog extends Basic
public function houseFollowUpList()
{
$params = $this->params;
/* $params = array(
"start_time" => time(), //开始时间
"end_time" => time() . " 23:59:59", //结束时间
"name_or_phone" => "li",//用户姓名或电话
"search_content" => "111",// 搜索跟进内容
"pageNo" => 1,
"pageSize" => 15
);*/
/*$params = array(
"start_time" => strtotime('2016-08-14 11:02:36'), //开始时间
"end_time" => strtotime('2018-08-14 11:07:10'), //结束时间
"name_or_phone" => "18112347151",//用户姓名或电话
"search_content" => "1",// 搜索跟进内容
"pageNo" => 1,
"pageSize" => 15
);*/
if (empty($params['start_time']) || empty($params['end_time'])) {
return $this->response("101", '请选择时间');
......@@ -119,38 +140,69 @@ class HomePageLog extends Basic
$pageNo = empty($params['pageNo']) ? 1 : $params['pageNo'];
$pageSize = empty($params['pageSize']) ? 15 : $params['pageSize'];
$field = "f.id,f.house_id,f.agent_id,f.follow_up_info,f.create_time,a.name,a.img,b.store_name,c.internal_title";
$field = "f.id,f.house_id,f.agent_id,f.follow_up_info,f.create_time,f.agent_name as name";
if (!empty($params["search_content"])) {
$where_["f.follow_up_info"] = array( "like", "%" . trim($params['search_content']) . "%" );
}
if (!empty($params["start_time"]) && !empty($params["end_time"])) {
$start_time = date("Y-m-d H:i:s", $params["start_time"]);
$end_time = date("Y-m-d H:i:s", $params["end_time"]);
$where_["f.create_time"] = array( 'between', array( $start_time, $end_time ) );
}
if (!empty($params["name_or_phone"])) {
$where_["a.phone|a.name"] = array( "like", "%" . trim($params["name_or_phone"]) . "%" );
}
if (empty($params['city'])) {
$where_["c.city"] = trim($this->city);
$where_["f.city"] = trim($this->city) ? trim($this->city) : '上海市';
} else {
$where_["c.city"] = $params['city'];
$where_["f.city"] = $params['city'] ? $params['city'] : '上海市';
}
if (!empty($params['disc'])) {
$where_["c.disc"] = $params['disc'];
$where_["f.disc"] = $params['disc'];
}
if (!empty($params["province"]) && !empty($params["province"])) {
$where_["f.province"] = $params["province"];
}
$join = [
[ 'a_agents a', 'a.id=f.agent_id', 'left' ],
[ 'a_store b', 'b.id=a.store_id', 'left' ],
[ 'g_houses c', 'f.house_id=c.id', 'left' ]
];
if (!empty($params["name_or_phone"])) {
if ((preg_match("/^1\d{10}$/", $params['name_or_phone']) != 1) or (strlen($params['name_or_phone']) < 6)) {
return $this->response("300", '手机号有误或者姓名不满两位汉字');
}
//$agent_params["phone|name"] = array( "like", "%" . trim($params["name_or_phone"]) . "%" );
$agent_params["phone|name"] = $params["name_or_phone"];
$agent_field = "id";
$model = new AAgents();
$res_a = $model->getAgentsIdsArray($agent_field, $agent_params);
if ($res_a) {
$where_["f.agent_id"] = [ 'in', $res_a ];
}
}
$join = [];
$order = "f.id desc";
$result = $this->gHouseFollowUpModel->getSearch($pageNo, $pageSize, $order, $field, $join, $where_, "");
$count = $this->gHouseFollowUpModel->getSearchCount($join, $where_);
foreach ($result as $key => $value) {
$agent_params = [];
$agent_params["a.id"] = $value['agent_id'];
$agent_field = "a.name,a.img,b.store_name";
$model = new AAgents();
$res_a = $model->getAgentsInfo($agent_field, $agent_params);
$result[$key]['name'] = $res_a[0]['name'];
$result[$key]['img'] = $res_a[0]['img'];
$result[$key]['store_name'] = $res_a[0]['store_name'];
$house_params = [];
$house_params["id"] = $value['house_id'];
$house_field = "internal_title";
$model = new GHouses();
$res_a = $model->getHouseInfo($house_field, $house_params);
$result[$key]['internal_title'] = $res_a[0]['internal_title'];
}
$count = $this->gHouseFollowUpModel->getSearchCount($join, $where_);
if (count($result) > 0) {
$list["result"] = $result;
$list["img_path"] = AGENTHEADERIMGURL;
......
......@@ -85,7 +85,7 @@ class Performance extends Basic
$house_id = $params["house_id"];
}
try {
$result = $this->service_->personagePerformance($params["agent_id"], $params["start_time"], $params["end_time"],
$result = $this->service_->personagePerformance($params["agent_id"], $params["start_time"], $params["end_time"] ." 23:59:59",
$params["is_case"], $house_id);
return $this->response("200", "request success", $result);
} catch (Exception $exception) {
......@@ -108,7 +108,7 @@ class Performance extends Basic
"end_time" => "2018-06-25",
);*/
try {
$result = $this->service_->storePerformance($params["agent_id"], $params["start_time"], $params["end_time"]);
$result = $this->service_->storePerformance($params["agent_id"], $params["start_time"], $params["end_time"]." 23:59:59");
return $this->response("200", "request success", $result);
} catch (Exception $exception) {
return $this->response("101", "request error,msg:" . $exception);
......@@ -164,11 +164,11 @@ class Performance extends Basic
"end_time" => "2018-04-12",
);*/
if (!isset($params["agent_id"]) || !isset($params["start_time"]) || !isset($params["end_time"])) {
if (!isset($params["agent_id"]) || !isset($params["start_time"]) || !isset($params["end_time"] )) {
return $this->response("101", "请求参数错误");
}
try {
$result = $this->service_->storeSortByDistrictId($params["agent_id"], $params["is_store"], $params["start_time"], $params["end_time"]);
$result = $this->service_->storeSortByDistrictId($params["agent_id"], $params["is_store"], $params["start_time"], $params["end_time"]." 23:59:59");
return $this->response("200", "request success", $result);
} catch (Exception $exception) {
......
......@@ -577,6 +577,14 @@ class Shop extends Basic
|| !isset($params["agent_name"]) || !isset($params["agent_phone"])) {
return $this->response("101", "请求参数错误");
}
$result = $this->gHousesModel->getHouseInfo('province,city,disc', [ 'id' => $params["house_id"]]);
if($result){
$params['province'] = $result[0]['province'] ? $result[0]['province'] : '上海市';
$params['city'] = $result[0]['city']? $result[0]['city'] : '上海市';
$params['disc'] = $result[0]['disc']? $result[0]['disc'] : '黄浦区';
}
$follow_up_model = new GHousesFollowUp();
$id = $follow_up_model->addHousesFollowUp($params);
if ($id > 0) {
......
......@@ -48,8 +48,13 @@ class CallPhoneService
return $result;
}
if ((strlen($phone_a) != 11) || (strlen($phone_b) != 11)) {
$result['msg'] = '号码格式错误,请重新填写!';
if (strlen($phone_a) != 11) {
$result['msg'] = '本机号码格式错误!';
return $result;
}
if (strlen($phone_b) != 11) {
$result['msg'] = '客户手机号码格式错误,请与客方沟通!';
return $result;
}
......
......@@ -19,8 +19,8 @@
<tr>
<td>商铺编号:{{d.id}}</td>
<td>商铺类型:{{(d.shop_type==1)?'街铺':'商场'}}</td>
<td>是否对客户展示:{{d.is_show?'否':'是'}}</td>
<td>是否独家:{{d.is_exclusive_type?'是':'否'}}</td>
<td>是否对客户展示:{{(d.is_show==1)?'否':'是'}}</td>
<td>是否独家:{{(d.is_exclusive_type==1)?'是':'否'}}</td>
</tr>
<tr>
<td>{{dealPrice}}</td>
......@@ -74,16 +74,16 @@
<tr class="tr-seat">
<td colspan="4"></td>
</tr>
<tr v-if="!d.is_show">
<tr v-if="!(d.is_show==1)">
<td colspan="2">对外商铺名称:{{d.external_title}}</td>
<td colspan="2">对外商铺地址:{{d.province}}{{d.city+d.disc+d.external_address}}</td>
</tr>
<tr v-if="!d.is_show">
<tr v-if="!(d.is_show==1)">
<td colspan="2">对外项目优势:{{d.external_item_advantage}}</td>
<td v-if="d.shop_type" colspan="2">对外转让费:{{(d.external_slotting_fee == '-1')?'面议':(d.external_slotting_fee+'元')}}</td>
<td v-else colspan="2"></td>
</tr>
<tr v-if="!d.is_show && d.cover_plan">
<tr v-if="!(d.is_show==1) && d.cover_plan">
<td colspan="4" class="oh">
<div class="fl">对外封面图:</div>
<div class="fl">
......@@ -132,8 +132,8 @@
<tr>
<td>上传时间:{{d.create_time}}</td>
<td>最后编辑时间:{{d.update_time}}</td>
<td v-if="d.is_exclusive_type">独家有效期:{{d.agent_start_time+'至'+d.agent_end_time}}</td>
<td v-if="d.is_exclusive_type"><!--独家方:{{d.exclusive_name}}--></td>
<td v-if="(d.is_exclusive_type==1)">独家有效期:{{d.agent_start_time+'至'+d.agent_end_time}}</td>
<td v-if="(d.is_exclusive_type==1)"><!--独家方:{{d.exclusive_name}}--></td>
</tr>
</tbody>
</table>
......
......@@ -21,6 +21,7 @@ use app\model\OFinancialAudit;
use app\model\OPartialCommission;
use app\model\OPayLogModel;
use app\model\ORefundModel;
use app\task\controller\ResultsSummaryNewTask;
class Finance extends Basic
{
......@@ -1433,13 +1434,30 @@ class Finance extends Basic
if (empty($this->params['scale'])) {
return $this->response(101, '分佣比例为空');
}
//检查成交报告是否存在
$data = $m_bargain->getBargainPartialDetail('a.id,a.agent_id,a.create_time', ['id'=>$this->params['bargain_id']]);
if (empty($data['id'])) {
return $this->response(101, '没有成交报告信息');
}
$update['agent_id'] = $this->params['agent_id'];
$update['scale'] = $this->params['scale'];
$update['role'] = $this->params['role'];
$update['scale_fee'] = $this->params['scale_fee'];
$data = $m_bargain->updateBargainById($this->params['bargain_id'], $update);
$data = $m_bargain->updateBargainById($this->params['bargain_id'], $update); //更改分佣方
//获取被修改人信息
$m_agent = new AAgents();
$agent_data = $m_agent->verifyUser('id,store_id,district_id', '',['id'=>$this->params['agent_id']]);
//更新业绩统计
$sum = new ResultsSummaryNewTask();
$date = date('Y-m-d', strtotime($data['create_time']));
$sum->updateTotalByAgentId($agent_data['id'], $agent_data['store_id'], $agent_data['district_id'], $date); //被修改的人
$sum->updateTotalByAgentId($data['agent_id'], $data['store_id'], $data['district_id'], $date);//修改为最新的分佣方
/*记录日志 start*/
$bargain_data = $m_bargain->selectBargainByOrderNo('agent_id,father_id', ['id'=>$this->params['bargain_id']]);
......
......@@ -7,18 +7,43 @@
*/
namespace app\index\controller;
use app\index\extend\Basic;
class HouseFollowUp extends Basic{
//在controller里新增的php文件名
public function followUpList(){
//followUpList 方法
if (!$this->request->isAjax()) {
return view('houses/HouseFollowUp');
//找到view下的 houses 文件夹下的 HouseFollowUp的html 文件
}
}
use app\model\GHouses;
use app\model\GHousesFollowUp;
class HouseFollowUp extends Basic
{
public function followUpList()
{
if (!$this->request->isAjax()) {
return view('houses/HouseFollowUp');
}
}
/**
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function transformFollowUp()
{
$time = time();
$m_house = new GHouses();
$m_follow = new GHousesFollowUp();
$total = $m_follow->getTotal();
$page = ceil($total / 5000);
for ($i = 1; $i <= $page; $i++) {
$data = $m_house->getList($i, 5000, 'id asc', 'id,province,city,disc');
foreach ($data as $k => $v) {
$insert['province'] = $v['province'];
$insert['city'] = $v['city'];
$insert['disc'] = $v['disc'];
$m_follow->where('house_id', $v['id'])->update($insert);
}
}
echo time() - $time . '秒';
}
}
\ No newline at end of file
This diff is collapsed.
......@@ -35,73 +35,88 @@ class Remark extends Basic
$data['status'] = 200;
$data['msg'] = '';
$where_user = $agent_where = [];
$pageNo = empty($this->params['pageNo']) ? 1 : $this->params['pageNo'];
$pageSize = empty($this->params['pageSize']) ? 15 : $this->params['pageSize'];
$u_phone_follow = new UPhoneFollowPp();
$last_month = date("Y-m-d", strtotime("-1 month"));
if (!empty($this->params['start_date']) && empty($this->params['end_date'])) {
$where['a.create_time'] = ['> time', $this->params['start_date']. ' 00:00:00'];
if (strtotime($last_month) > strtotime($this->params['start_date'])) {
$where['create_time'] = ['> time', $last_month. ' 00:00:00'];
} else {
$where['create_time'] = ['> time', $this->params['start_date']. ' 00:00:00'];
}
} else {
$where['create_time'] = ['> time', $last_month. ' 00:00:00'];
}
if (!empty($this->params['end_date']) && empty($this->params['start_date'])) {
$where['a.create_time'] = ['< time', $this->params['end_date']. ' 23:59:59'];;
$where['create_time'] = ['< time', $this->params['end_date']. ' 23:59:59'];;
}
if (!empty($this->params['end_date']) && !empty($this->params['start_date'])) {
$where['a.create_time'] = ['between',[$this->params['start_date'].' 00:00:00',$this->params['end_date']. ' 23:59:59']];
}
if (!empty($this->params['customer'])) {
$where['c.user_name'] = $this->params['customer'];
}
if (!empty($this->params['phone'])) {
$where['c.user_phone'] = $this->params['phone'];
if (strtotime($last_month) > strtotime($this->params['start_date'])) {
$start_date = $last_month;
} else {
$start_date = $this->params['start_date'];
}
$where['create_time'] = ['between',[$start_date.' 00:00:00',$this->params['end_date']. ' 23:59:59']];
}
if (!empty($this->params['content'])) {
$where['a.content'] = ['like',"%{$this->params['content']}%"];
$where['content'] = ['LIKE',"%{$this->params['content']}%"];
}
//跟进人名字
if (!empty($this->params['remark_name'])) {
$where['b.name'] = ['like', "%{$this->params['remark_name']}%"];
$agent_where['name'] = $this->params['remark_name'];
}
//跟进人手机号
if (!empty($this->params['remark_phone'])) {
$where['b.phone'] = ['like', "%{$this->params['remark_phone']}%"];
$agent_where['phone'] = $this->params['remark_phone'];
}
//跟进人门店
if (!empty($this->params['remark_store_id'])) {
$where['b.store_id'] = $this->params['remark_store_id'];
$agent_where['store_id'] = $this->params['remark_store_id'];
}
//跟进人部门
if (!empty($this->params['remark_district_id'])) {
$where['b.district_id'] = $this->params['remark_district_id'];
$agent_where['district_id'] = $this->params['remark_district_id'];
}
if (!empty($this->params['province'])) {
$where['c.province'] = $this->params['province'];
$where['province'] = $this->params['province'];
}
if (!empty($this->params['city'])) {
$where['c.city'] = $this->params['city'];
$where['city'] = $this->params['city'];
}
if (!empty($this->params['disc'])) {
$where['c.disc'] = $this->params['disc'];
$where['disc'] = $this->params['disc'];
}
if (!empty($this->params['id'])) {
$where['user_id'] = $this->params['id'];
}
$field = 'c.id,a.create_time,a.content,b.name as admin,d.name as label_name,c.user_name,c.user_phone,a.user_status,c.vip,c.agent_id';
$data['data']['list'] = $u_phone_follow->getFollowList($pageNo, $pageSize, $order_ = 'a.id desc', $field, $where);
if (!empty($where_user)) {
$m_agent = new AAgents();
$agent_id_arr = $m_agent->getAgentById('id', $agent_where);
if (!empty($agent_id_arr)) {
$where['agent_id'] = ['in', $agent_id_arr];
}
}
$field = 'user_id,create_time,content,user_status,labels_id,agent_id as f_agent_id';
$data['data']['list'] = $u_phone_follow->getFollowList($pageNo, $pageSize, $order_ = 'id desc', $field, $where);
foreach ($data['data']['list'] as $k=>$v) {
$data['data']['list'][$k]['user_phone'] = hide_customer_phone($data['data']['list'][$k]['user_phone']);
$data['data']['list'][$k]['user_phone'] = substr_replace($data['data']['list'][$k]['user_phone'],'****',3,4);
}
$data['data']['total'] = $u_phone_follow->getFollowTotal($where);
......
......@@ -338,10 +338,10 @@
<tr>
<td colspan="11">
<form action="" method="get" id="form_search">
<!--<span class="fore-span ld-Marheight">创建时间:</span>
<span class="fore-span ld-Marheight">创建时间:</span>
<input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="start_date" name="start_date" type="date">
<span class="fore-span ld-Marheight">-</span>
<input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="end_date" name="end_date" type="date">-->
<input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="end_date" name="end_date" type="date">
<span class="fore-span ld-Marheight">注册时间:</span>
<input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="registration_start" name="registration_start" type="date">
......@@ -446,6 +446,7 @@
<input class="form-control btn2 margin-top-ld input" data-rule-phoneus="false" data-rule-required="false" name="invite_agent_phone" placeholder="邀请人(经纪人)手机号" type="text" value="">
<!--<div class="clear"></div>-->
<!--<span class='left bottom'>(注:客方所属部门,客方所属门店与邀请人所属部门,邀请人所属门店不作为并列筛选项)</span>-->
<div class="clear"></div>
<span class="fore-span ld-Marheight">首次登录时间:</span>
<input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="first_login_start" type="date">
<span class="fore-span ld-Marheight">-</span>
......@@ -459,7 +460,7 @@
<select class="form-control btn2 ld-Marheight" id="user_area_choose">
<option value="" selected="selected">区域筛选</option>
</select>
<div class="clear"></div>
<span class="btn btn-info btn3 margin-top-ld" id="search">搜索</span>
<span class="btn btn-info btn3 margin-top-ld" id="reset">重置</span>
<!--<a class="btn btn-info btn3 margin-top-ld user-favorites"> 收藏夹 </a>-->
......
......@@ -18,7 +18,21 @@
#rank_start_day,#rank_end_day,#performance_ranking{
font-size: 16px;
}
/*倒序 正序 样式*/
.positive-sequence-yeji,.reverse-order-yeji{
position: relative;
margin-left: 5px;
cursor: pointer;
font-size: 20px;
}
.positive-sequence-yeji{
top: 11px;
}
.reverse-order-yeji{
top: -5px;
left: -25px;
}
</style>
<div id="page-content-wrapper">
......
......@@ -310,8 +310,8 @@
<input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="start_date" name="start_date" type="date">
<span class="fore-span ld-Marheight">-</span>
<input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="end_date" name="end_date" type="date">
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="customer_name" placeholder="客户姓名" type="text" value="">
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="customer_phone" placeholder="客户手机号" type="tel" value="">
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="customer_name_id" placeholder="客户编号" type="text" value="">
<!--<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="customer_phone" placeholder="客户手机号" type="tel" value="">-->
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="follow_content" placeholder="跟进内容" type="text" value="">
......
......@@ -273,7 +273,7 @@ class AAgents extends BaseModel
$where_["level"] = $params["level"];
}
if (isset($params['in_id'])) {
$where_['id'] = ['in', $params['in_id']];
$where_['id'] = [ 'in', $params['in_id'] ];
}
$result = $this->field($field)
->where($where_)
......@@ -352,8 +352,10 @@ class AAgents extends BaseModel
*/
public function getAgentsListByTask($pageNo = 1, $pageSize = 15, $field = "id")
{
$params["district_id"] = array( 'not in', array( '13', '14', '15' ) );
return Db::table($this->table)
->field($field)
->where($params)
->limit($pageSize)
->page($pageNo)
->select();
......@@ -387,7 +389,9 @@ class AAgents extends BaseModel
*/
public function getAgentsCountByTask()
{
$params["district_id"] = array( 'not in', array( '13', '14', '15' ) );
return Db::table($this->table)
->where($params)
->count();
}
......@@ -489,12 +493,13 @@ class AAgents extends BaseModel
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getStoreOrDistrict($params){
public function getStoreOrDistrict($params)
{
$result = Db::table($this->table)
->field("id,name,img")
->where($params)
->select();
//echo Db::table($this->table)->getLastSql();
//echo Db::table($this->table)->getLastSql();
return $result;
}
......@@ -776,15 +781,15 @@ class AAgents extends BaseModel
public function getUser($pageNo = 1, $pageSize = 15, $order_ = 'id desc', $field, $params, $house_id = '')
{
return $this->field($field)->alias('a')
->join('u_evaluate b', 'a.id = b.agents_id', 'left')
->join('g_houses_to_agents c', 'a.id=c.agents_id', 'left')
->where('c.type', 1)
->where($params)
->group('a.id')
->order($order_)
->limit($pageSize)
->page($pageNo)
->select();
->join('u_evaluate b', 'a.id = b.agents_id', 'left')
->join('g_houses_to_agents c', 'a.id=c.agents_id', 'left')
->where('c.type', 1)
->where($params)
->group('a.id')
->order($order_)
->limit($pageSize)
->page($pageNo)
->select();
}
/**
......@@ -798,7 +803,8 @@ class AAgents extends BaseModel
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function searchAgentShop($pageNo = 1, $pageSize = 15, $order_ = 'id desc', $field = '', $params = '') {
public function searchAgentShop($pageNo = 1, $pageSize = 15, $order_ = 'id desc', $field = '', $params = '')
{
return $this->field($field)
->alias('a')
->join('a_store b', 'a.store_id = b.id', 'left')
......@@ -818,10 +824,11 @@ class AAgents extends BaseModel
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getAgentsList($field,$params,$group){
public function getAgentsList($field, $params, $group)
{
$where_ = [];
if($group == "store_id"){
$where_['level'] = array("in",[20,40]);
if ($group == "store_id") {
$where_['level'] = array( "in", [ 20, 40 ] );
}
$result = Db::name($this->table)
->field($field)
......@@ -844,11 +851,12 @@ class AAgents extends BaseModel
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getUserAgent($field = '', $params = [], $house_id = 0) {
public function getUserAgent($field = '', $params = [], $house_id = 0)
{
$data = $this->field($field)->alias('a')
->join('u_evaluate b', 'a.id = b.agents_id', 'left')
->join('g_houses_to_agents c', 'a.id=c.agents_id', 'left')
->join('u_users d','a.id = d.agent_id', 'left')
->join('u_users d', 'a.id = d.agent_id', 'left')
->where('c.houses_id', $house_id)
->where('c.type', 1)
->where($params)
......@@ -866,10 +874,11 @@ class AAgents extends BaseModel
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getAgentClient(string $field = '*', array $params = []) {
public function getAgentClient(string $field = '*', array $params = [])
{
return $this->field($field)->alias('a')
->join('u_evaluate b', 'a.id = b.agents_id', 'left')
->join('u_users c','a.id = c.agent_id', 'left')
->join('u_users c', 'a.id = c.agent_id', 'left')
->where($params)
->find();
}
......@@ -907,12 +916,12 @@ class AAgents extends BaseModel
if ($id) {
$result = $this->field('id,name as realname,create_time,img,store_id')->find($id);
$evaluate_grade = Db::table('u_evaluate')
$evaluate_grade = Db::table('u_evaluate')
->field('sum(evaluate_grade) as evaluate_grade, count(*) as evaluate_num')
->where('agents_id', $id)->where('is_show', 0)->find();
$m_store = new AStore();
$result['sub_shopname'] = $m_store->getStoreKeyById('store_name', ['id'=>$result['store_id']]);
$m_store = new AStore();
$result['sub_shopname'] = $m_store->getStoreKeyById('store_name', [ 'id' => $result['store_id'] ]);
if ($evaluate_grade['evaluate_grade']) {
$grade = floor(($evaluate_grade['evaluate_grade'] / 2) / $evaluate_grade['evaluate_num']);
} else {
......@@ -924,9 +933,9 @@ class AAgents extends BaseModel
$result['watch_shop'] = Db::table('u_appoint_watch_shop')
->where('agents_id', $id)->count(); //看铺
$result['head_portrait'] = AGENTHEADERIMGURL.$result['img'];
$result['head_portrait'] = AGENTHEADERIMGURL . $result['img'];
$bargain = new OBargainModel();
$bargain = new OBargainModel();
$result['JournalAccounts'] = $bargain->ifBargainNumByOrderId([ 'agent_id' => $id ]); //成交记录
$current_time = time();
......@@ -956,7 +965,8 @@ class AAgents extends BaseModel
* @param $data
* @return AAgents|bool
*/
public function updateData($id, $data) {
public function updateData($id, $data)
{
if ($id) {
$result = $this->where('id', $id)->update($data);
} else {
......@@ -985,4 +995,36 @@ class AAgents extends BaseModel
//dump($this->getLastSql());
return $result;
}
public function getAgentsIdsArray($field, $params)
{
$params["status"] = 0;
$result = Db::table($this->table)
->field($field)
->where($params)
->select();
if($result){
$agentIds = "";
foreach ($result as $key1 => $value1) {
$agentIds .= $value1["id"] . ',';
}
$agentIds = rtrim($agentIds, ",");//经纪人ID集合
}
return $agentIds;
}
public function getAgentsInfo($field, $params)
{
$params["a.status"] = 0;
$result = Db::table($this->table)
->alias('a')
->join('a_store b', 'b.id=a.store_id', 'left' )
->field($field)
->where($params)
->select();
return $result;
}
}
\ No newline at end of file
......@@ -92,5 +92,25 @@ class ASuperviseModel extends Model
->select();
}
/**
* 统计监督执行数量分时间
* @param $params
* @return false|\PDOStatement|string|\think\Collection
*/
public function getAddPayLogNumGroupTimeNew($params){
$field = "count(1) as num";
$where_ = [];
if(isset($params["agent_id"])){
$where_["agent_id"] = $params["agent_id"];
}
if(isset($params["create_time"])){
$where_["create_time"] = $params["create_time"];
}
return Db::table($this->table)
->field($field)
->where($where_)
->select();
}
}
\ No newline at end of file
......@@ -272,21 +272,30 @@ class GHouses extends BaseModel
*/
public function getHouseListDish($pageNo = 1, $pageSize = 15, $order_ = 'id desc', $field = '', $params = '', $agents_id = '')
{
$data = $this->field($field)->alias('a')
->join('g_houses_to_agents b', 'a.id=b.houses_id', 'left')
->join('a_agents c', 'b.agents_id=c.id', 'left')
->join('g_houses_ext d', 'a.id=d.house_id', 'left')
// $data = $this->field($field)->alias('a')
// ->join('g_houses_to_agents b', 'a.id=b.houses_id', 'left')
// ->join('a_agents c', 'b.agents_id=c.id', 'left')
// ->join('g_houses_ext d', 'a.id=d.house_id', 'left')
// ->where($params)
// ->order($order_)
// ->limit($pageSize)
// ->page($pageNo)
// ->group('a.id')
// ->select();
$data = $this->field($field)
->where($params)
->order($order_)
->limit($pageSize)
->page($pageNo)
->group('a.id')
->select();
$house_id = array();
$house_id = [];
$house_follow_up = new GHousesFollowUp();
foreach ($data as $k => $v) {
$house_id[$k] = $v['id'];
$house_id[$k] = $v['id'];
$v->create_time = date('Y-m-d', strtotime($v->create_time));
$data[$k]['last_follow_up'] = $house_follow_up->where('house_id',$v['id'])->value('create_time');
}
......@@ -340,14 +349,15 @@ class GHouses extends BaseModel
*/
public function getHouseListDishTotal($params = '')
{
$data = $this->alias('a')
->join('g_houses_to_agents b', 'a.id=b.houses_id', 'left')
->join('a_agents c', 'b.agents_id=c.id', 'left')
->join('g_houses_ext d', 'a.id=d.house_id', 'left')
->where($params)
->group('a.id')
->count();
return $data;
// $data = $this->alias('a')
// ->join('g_houses_to_agents b', 'a.id=b.houses_id', 'left')
// ->join('a_agents c', 'b.agents_id=c.id', 'left')
// ->join('g_houses_ext d', 'a.id=d.house_id', 'left')
// ->where($params)
// ->group('a.id')
// ->count();
// return $data;
return $this->where($params)->count();
}
/**
......@@ -728,6 +738,27 @@ class GHouses extends BaseModel
->select();
}
/**
* 获取添加的楼盘的每天数量
* @param $params
* @return false|\PDOStatement|string|\think\Collection
*/
public function getAddHouseNumGroupTimeNew($params)
{
$field = "count(1) as num";
$where_ = [];
if (isset($params["agent_id"])) {
$where_["upload_id"] = $params["agent_id"];
}
if (isset($params["create_time"])) {
$where_["create_time"] = $params["create_time"];
}
return Db::table($this->table)
->field($field)
->where($where_)
->select();
}
/**
* 获取新增楼盘数量
* @param $params
......@@ -743,6 +774,9 @@ class GHouses extends BaseModel
if (isset($params["create_time"])) {
$where_["create_time"] = $params["create_time"];
}
if (isset($params['landlord_phone'])) {
$where_["landlord_phone"] = $params['landlord_phone'];
}
$result = Db::table($this->table)
->field($field)
->where($where_)
......@@ -751,11 +785,17 @@ class GHouses extends BaseModel
return $result;
}
/**
* 获取新增楼盘数据
*
* @param $params
* @param $field
* @param $page_no
* @param $page_size
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getAddHouseList($params, $field, $page_no, $page_size)
{
......@@ -1112,4 +1152,34 @@ class GHouses extends BaseModel
return $result;
}
public function getHouseIdsArray($field, $params)
{
$result = Db::table($this->table)
->field($field)
->where($params)
->select();
if($result){
$houseids = "";
foreach ($result as $key1 => $value1) {
$houseids .= $value1["id"] . ',';
}
$houseids = rtrim($houseids, ",");//经纪人ID集合
}
return $houseids;
}
public function getHouseInfo($field, $params)
{
$result = Db::table($this->table)
->field($field)
->where($params)
->select();
return $result;
}
}
......@@ -3,7 +3,6 @@
namespace app\model;
use think\Db;
use think\Model;
/**
* Created by PhpStorm.
......@@ -12,7 +11,7 @@ use think\Model;
* Time : 下午4:31
* Intro:
*/
class GHousesFollowUp extends Model
class GHousesFollowUp extends BaseModel
{
protected $table = "g_houses_follow_up";
protected $db_;
......@@ -51,6 +50,19 @@ class GHousesFollowUp extends Model
$where_['landlord_name'] = $params['landlord_name'];
}
if (isset($params["province"])) {
$where_["province"] = $params["province"];
}
if (isset($params["city"])) {
$where_["city"] = $params["city"];
}
if (isset($params["disc"])) {
$where_["disc"] = $params["disc"];
}
$where_["create_time"] = date("Y-m-d H:i:s", time());
$where_["update_time"] = date("Y-m-d H:i:s", time());
Db::startTrans();
......@@ -68,6 +80,9 @@ class GHousesFollowUp extends Model
* @param $field
* @param $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getShopFollowUpList($field, $params)
{
......@@ -84,7 +99,6 @@ class GHousesFollowUp extends Model
}
/**
* 首页商铺跟进搜索
* @param int $p
* @param int $pageSize
* @param string $order_
......@@ -93,6 +107,9 @@ class GHousesFollowUp extends Model
* @param $where
* @param $group
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getSearch($p = 1, $pageSize = 15, $order_ = 'id desc', $field, $join, $where, $group)
{
......@@ -106,7 +123,7 @@ class GHousesFollowUp extends Model
->limit($pageSize)
->page($p)
->select();
// echo $this->getLastSql();
//echo $this->getLastSql();
return $data;
}
......@@ -126,6 +143,13 @@ class GHousesFollowUp extends Model
return $data;
}
/**
* @param array $params
* @return bool
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getFollowUpByHouseId(array $params): bool
{
$where_ = [];
......
......@@ -200,6 +200,20 @@ class GHousesToAgents extends BaseModel
return $result;
}
/**
* @param $field
* @param $params
* @return array
*/
public function getAgentsHouseField($field, $params)
{
return $this->field($field)
->alias("a")
->join("a_agents b", "a.agents_id = b.id", "left")
->where($params)
->column($field);
}
/**
* 楼盘对应的经纪人信息
*
......@@ -250,14 +264,15 @@ class GHousesToAgents extends BaseModel
*
* @param $house_id
* @param int $type
* @return array|\PDOStatement|string|\think\Model
* @param string $field
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getAgentList($house_id, $type = 1)
public function getAgentList($house_id, $type = 1, $field = 'b.id,device_id,b.name,b.phone')
{
return $this->field('b.id,device_id,b.name,b.phone')
return $this->field($field)
->alias('a')
->join('a_agents b', 'a.agents_id = b.id', 'left')
->where('houses_id', $house_id)
......
......@@ -51,14 +51,20 @@ class GOperatingRecords extends BaseModel
return $result;
}
/**
* @param $user_id
* @return array|false|\PDOStatement|string|\think\Collection
*/
public function user_history($user_id)
{
return db('g_operating_records')
->where('user_id',$user_id)
->field('name,remark,create_time')
->order('create_time', 'desc')
->select();
try {
$data = $this->field('name,remark,create_time')
->where('user_id',$user_id)
->order('create_time', 'desc')
->select();
} catch (\Exception $e) {
$data = [];
}
return $data;
}
}
\ No newline at end of file
......@@ -626,6 +626,34 @@ class OBargainModel extends Model
->select();
}
/**
* @param $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getReceivedGroupTimeNew($params)
{
$where_ = [];
$field = "sum(b.practical_fee) as num";
if (isset($params["agent_id"])) {
$where_["a.agent_id"] = $params["agent_id"];
}
if (isset($params["create_time"])) {
$where_["b.create_time"] = $params["create_time"];
}
return Db::table($this->table)
->field($field)
->alias("a")
->join("o_partial_commission b", "a.id=b.bargain_id", "right")
->where($where_)
->select();
}
/**
* @param $params
* @param $type
......@@ -655,6 +683,7 @@ class OBargainModel extends Model
if (isset($params["agent_id"]) && $type == 3) {
unset($where_["agent_id"]);
$where_["submit_agent_id"] = $params["agent_id"];
$where_["father_id"] = 0;
}
if (isset($params["create_time"])) {
......@@ -668,6 +697,44 @@ class OBargainModel extends Model
->select();
}
/**
* @param $params
* @param $type
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getAddBargainNumGroupTimeNew($params, $type)
{
$field = "";
$where_ = [];
if ($type == 1) {
$field = "sum(scale_fee) as num";
} elseif ($type == 2) {
$field = "sum(practical_fee) as num";
} elseif ($type == 3) {
$field = "count(1) as num";
$where_["trade_type"] = 10;//产品要求统计数量必须是出租类型的180620
$where_["role"] = 3;//必须是反签方
}
if (isset($params["agent_id"])) {
$where_["agent_id"] = $params["agent_id"];
}
if (isset($params["create_time"])) {
$where_["create_time"] = $params["create_time"];
}
$data = Db::table($this->table)
->field($field)
->where($where_)
->select();
//echo $this->getLastSql();
return $data;
}
public function getAddBargainNum($params, $type)
{
$where_ = [];
......@@ -709,7 +776,7 @@ class OBargainModel extends Model
->join($join)
->where($where_)
->select();
// echo $this->getLastSql();
// echo $this->getLastSql();
return $return;
}
......@@ -794,8 +861,8 @@ class OBargainModel extends Model
$where_ = [];
if (isset($params["agent_id"])) {
$where_["c.report_agent_id"] = $params["agent_id"];
$where_["a.agent_id"] = $params["agent_id"];
$where_["a.agent_id"] = $params["agent_id"];
$where_["a.role"] = 3;
}
if (isset($params["create_time"])) {
$where_["a.create_time"] = $params["create_time"];
......@@ -1180,12 +1247,14 @@ class OBargainModel extends Model
->find();
$m_agent = new AAgents();
$filed_agent = 'a.id,a.name,a.phone,b.store_name,c.district_name';
$filed_agent = 'a.id,a.name,a.phone,b.store_name,c.district_name,a.store_id,a.district_id';
$agent_info = $m_agent->getAgentsInfoByAgentId($filed_agent, [ 'agent_id' => $result['agent_id'] ]);
$result['district_name'] = $agent_info[0]['district_name'];
$result['store_name'] = $agent_info[0]['store_name'];
$result['name'] = $agent_info[0]['name'];
$result['phone'] = $agent_info[0]['phone'];
$result['store_id'] = $agent_info[0]['store_id'];
$result['district_id'] = $agent_info[0]['district_id'];
} catch (\Exception $ex) {
$result = false;
......@@ -1233,15 +1302,15 @@ class OBargainModel extends Model
}
public function performancelInfo($where,$filed,$pageSize,$pageNo){
$result = $this->db_
public function performancelInfo($where, $filed, $pageSize, $pageNo)
{
$result = $this->db_
->field($filed)
->alias("Obargain")
->join("o_report Oreport", "Obargain.report_id = Oreport.id", "left")
->join("o_order Oorder", "Obargain.order_id = Oorder.id", "left")
->join("g_houses Houses", "Oorder.house_id = Houses.id", "left")
->join("a_agents Agent", "Obargain.agent_id = Agent.id", "left")
->join("o_order Oorder", "Obargain.order_id = Oorder.id", "left")
->join("g_houses Houses", "Oorder.house_id = Houses.id", "left")
->join("a_agents Agent", "Obargain.agent_id = Agent.id", "left")
->join('a_store Store', 'Agent.store_id = Store.id', 'left')
->join('a_district District', 'Agent.district_id = District.id', 'left')
->where($where)
......@@ -1253,14 +1322,15 @@ class OBargainModel extends Model
return $result;
}
public function performancelInfoTotal($where,$filed){
$result = $this->db_
public function performancelInfoTotal($where, $filed)
{
$result = $this->db_
->field($filed)
->alias("Obargain")
->join("o_report Oreport", "Obargain.report_id = Oreport.id", "left")
->join("o_order Oorder", "Obargain.order_id = Oorder.id", "left")
->join("g_houses Houses", "Oorder.house_id = Houses.id", "left")
->join("a_agents Agent", "Obargain.agent_id = Agent.id", "left")
->join("o_order Oorder", "Obargain.order_id = Oorder.id", "left")
->join("g_houses Houses", "Oorder.house_id = Houses.id", "left")
->join("a_agents Agent", "Obargain.agent_id = Agent.id", "left")
->join('a_store Store', 'Agent.store_id = Store.id', 'left')
->join('a_district District', 'Agent.district_id = District.id', 'left')
->where($where)
......
......@@ -115,6 +115,27 @@ class OMarchInModel extends Model
->select();
}
/**
* 查询经纪人进场数据 todo 产品定义同一天带看同一个客户去多个铺子算一个带看,下个方法同样
* @param $params
* @return false|\PDOStatement|string|\think\Collection
*/
public function getAddMarchInNumGroupTimeNew($params)
{
$field = "count(DISTINCT report_id) as num";
$where_ = [];
if (isset($params["agent_id"])) {
$where_["reception_id"] = $params["agent_id"];
}
if (isset($params["create_time"])) {
$where_["create_time"] = $params["create_time"];
}
return Db::table($this->table)
->field($field)
->where($where_)
->select();
}
/**
* 统计房源进场数据 过滤重负
* @param $params
......
......@@ -160,6 +160,27 @@ class OPayLogModel extends Model
->group("day")
->select();
}
/**
* @param $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getAddPayLogNumGroupTimeNew($params){
$field = "count(1) as num";
$where_ = [];
if(isset($params["agent_id"])){
$where_["agent_id"] = $params["agent_id"];
}
if(isset($params["create_time"])){
$where_["create_time"] = $params["create_time"];
}
return Db::table($this->table)
->field($field)
->where($where_)
->select();
}
/**
* @param $params
......
......@@ -546,6 +546,30 @@ class OReportModel extends Model
->select();
}
/**
* @param $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getAddReportNumGroupTimeNew($params)
{
$field = "count(1) as num";
$where_ = [];
if (isset($params["agent_id"])) {
$where_["report_agent_id"] = $params["agent_id"];
}
if (isset($params["create_time"])) {
$where_["create_time"] = $params["create_time"];
}
$where_["status"] = 0;
return Db::table($this->table)
->field($field)
->where($where_)
->select();
}
/**
* @param $params
* @return false|\PDOStatement|string|\think\Collection
......
......@@ -40,6 +40,24 @@ class TAgentTotalModel extends Model
return 0;
}
}
/**
* @param $params
* @return int
*/
public function saveTotal($params)
{
Db::startTrans();
try {
$this->saveAll($params);
Db::commit();
return 1;
} catch (\Exception $e) {
print_r($e);
Db::rollback();
return 0;
}
}
/**
* 获取最后统计的时间
......
......@@ -41,6 +41,16 @@ class UPhoneFollowPp extends BaseModel
if (isset($params["user_status"])) {
$arr["user_status"] = $params["user_status"];
}
if (isset($params["province"])) {
$arr["province"] = $params["province"];
}
if (isset($params["city"])) {
$arr["city"] = $params["city"];
}
if (isset($params["disc"])) {
$arr["disc"] = $params["disc"];
}
$result = $this->UPhoneFollowPp->insert($arr);
return $result;
}
......@@ -92,15 +102,13 @@ class UPhoneFollowPp extends BaseModel
}
/**
* @param $join
* @param $where
* @return int
*/
public function getSearchCount( $join, $where)
public function getSearchCount( $where)
{
$r = $this
->alias('f')
->join($join)
->where($where)
->count();
return $r;
......@@ -254,16 +262,43 @@ class UPhoneFollowPp extends BaseModel
* @throws \think\exception\DbException
*/
public function getFollowList($pageNo = 1, $pageSize = 15, $order_ = 'id desc', $field = '', $params = '') {
return $this->field($field)
->alias('a')
->join('a_agents b','a.agent_id = b.id', 'left')
->join('u_users c','a.user_id = c.id', 'left')
->join('u_labels d','d.id = a.labels_id', 'left')
$data = $this->field($field)
->where($params)
->order($order_)
->limit($pageSize)
->page($pageNo)
->select();
$m_label = new ULabels();
$m_user = new Users();
$m_agent = new AAgents();
$label_data = $m_label->field('id,name')->where('type', 1)->select();
foreach ($data as $k => $v) {
if (!empty($v['f_agent_id'])) {
$data[$k]['admin'] = $m_agent->getAgentsById($v['f_agent_id'], 'name');
}
if (!empty($v['user_id'])) {
$user_data = $m_user->getUserById('user_name,user_phone,vip,agent_id', $v['user_id']);
$data[$k]['user_name'] = $user_data['user_name'];
$data[$k]['user_phone'] = $user_data['user_phone'];
$data[$k]['vip'] = $user_data['vip'];
$data[$k]['agent_id'] = $user_data['agent_id']; //客户客方
}
if (!isset($v['labels_id'])) {
continue;
}
foreach ($label_data as $k2=>$v2) {
if ($v2['id'] == $v['labels_id']) {
$data[$k]['label_name'] = $v2['name'];
}
}
}
return $data;
}
/**
......@@ -274,10 +309,7 @@ class UPhoneFollowPp extends BaseModel
*/
public function getFollowTotal($params)
{
return $this->alias('a')
->join('a_agents b','a.agent_id = b.id', 'left')
->join('u_users c','a.user_id = c.id', 'left')
->where($params)
return $this->where($params)
->count();
}
......
......@@ -494,6 +494,27 @@ class Users extends Model
->select();
}
/**
* 按添加时间段分组统计
* @param $params
* @return false|\PDOStatement|string|\think\Collection
*/
public function getAddUserNumGroupTimeNew($params)
{
$field = "count(1) as num";
$where_ = [];
if (isset($params["agent_id"])) {
$where_["agent_id"] = $params["agent_id"];
}
if (isset($params["create_time"])) {
$where_["create_time"] = $params["create_time"];
}
return Db::table($this->table)
->field($field)
->where($where_)
->select();
}
public function getAddUserNum($params)
{
$field = "count(1) as num";
......@@ -769,5 +790,17 @@ class Users extends Model
return $return;
}
public function getUserCityInfo($id)
{
$field='province,city,disc';
$params= [ 'id' => $id ];
$result = Db::table($this->table)
->field($field)
->where($params)
->select();
return $result;
}
}
......@@ -280,6 +280,7 @@ Route::group('index', [
'selectDistrictPerformance' => [ 'index/Performance/selectDistrictPerformance', [ 'method' => 'POST|GET' ] ], //区域业绩排行 朱伟 2018-07-31
'selectStorePerformance' => [ 'index/Performance/selectStorePerformance', [ 'method' => 'POST|GET' ] ], //门店业绩排行 朱伟 2018-07-31
'selectIndividualPerformance' => [ 'index/Performance/selectIndividualPerformance', [ 'method' => 'POST|GET' ] ], //个人业绩排行 朱伟 2018-07-31
'transformFollowUp' => [ 'index/HouseFollowUp/transformFollowUp', [ 'method' => 'GET' ] ], //个人业绩排行 朱伟 2018-07-31
......@@ -395,6 +396,8 @@ Route::group('task', [
'totalAgentResults_new' => [ 'task/ResultsSummaryTask/totalAgentResults', [ 'method' => 'get' ] ], //业绩统计
'totalAgentResults' => [ 'task/ResultsSummaryNewTask/totalAgentResults', [ 'method' => 'get' ] ], //业绩统计
'updateTotalByAgentId' => [ 'task/ResultsSummaryNewTask/updateTotalByAgentId', [ 'method' => 'get' ] ], //业绩统计
'rongBilledInformUrl' => [ 'task/PrivacyNumber/rongBilledInformUrl', [ 'method' => 'post | get' ] ],//隐私号码回调[话单通知]
......
<?php
namespace app\task\controller;
use app\extra\RedisExt;
use app\model\AAgents;
use app\model\ASuperviseModel;
use app\model\GHouses;
use app\model\OBargainModel;
use app\model\OMarchInModel;
use app\model\OPayLogModel;
use app\model\OReportModel;
use app\model\TAgentTotalModel;
use app\model\Users;
/**
* Created by PhpStorm.
* User : zw
* Date : 2018/3/15
* Time : 上午10:07
* Intro:
*/
class ResultsSummaryNewTask
{
private $agentsModel;
private $tAgentTotalModel;
private $houseModel;
private $userModel;
private $bargainModel;
private $reportModel;
private $marchInModel;
private $payLogModel;
private $superviseModel;
private $redis_;
function __construct()
{
$this->agentsModel = new AAgents();
$this->tAgentTotalModel = new TAgentTotalModel();
$this->houseModel = new GHouses();
$this->userModel = new Users();
$this->bargainModel = new OBargainModel();
$this->reportModel = new OReportModel();
$this->marchInModel = new OMarchInModel();
$this->payLogModel = new OPayLogModel();
$this->redis_ = RedisExt::getRedis();
$this->superviseModel = new ASuperviseModel();
}
public function totalAgentResults()
{
set_time_limit(0); // 取消脚本运行时间的超时上限
//todo 按小时统计
//todo 1.分页查询经纪人, 2遍历执行,判断一个经纪人在统计表最后一条统计数据的日期
//TODO 3.日期加一天并判断是否大于等于当前时间大于return 4.执行此日期的统计,5.当次日期小于当前日期,递归日期加一。继续统计
$total = $this->agentsModel->getAgentsCountByTask();
$pageSize = 100;
$pageTotal = ceil($total / $pageSize);
for ($pageNo = 1; $pageNo <= $pageTotal; $pageNo++) {
$resultArr = $this->agentsModel->getAgentsListByTask($pageNo, $pageSize, "id,store_id,district_id");
$this->executeTotal($resultArr, null);
unset($resultArr);
}
unset($this->agentsModel);
unset($this->tAgentTotalModel);
unset($this->houseModel);
unset($this->userModel);
unset($this->bargainModel);
unset($this->reportModel);
unset($this->marchInModel);
unset($this->payLogModel);
}
/**
* @param $agent_id
* @param $store_id
* @param $district_id
* @param $total_time 比如修改了数据如成交报告,成交报告提交时间是昨天那么这里的时间就是昨天
*/
public function updateTotalByAgentId($agent_id,$store_id,$district_id,$total_time)
{
$params[0]["id"] = $agent_id;
$params[0]["store_id"] = $store_id;
$params[0]["district_id"] = $district_id;
/* $params[0]["id"] = 5439;
$params[0]["store_id"] = 92;
$params[0]["district_id"] = 2;
$total_time = '2018-08-15';*/
$this->executeTotal($params, $total_time);
}
private function executeTotal($resultArr, $total_time)
{
$start_total_time = date("Y-m-d 00:00:00", time());
$end_total_time = date("Y-m-d H:i:s", time());
if (!empty($total_time)) {
$start_total_time = $total_time . " 00:00:00";
$end_total_time = $total_time . " 23:59:59";
} else {
$total_time = date("Y-m-d", time());
}
$insertArr = $updateArr = [];
foreach ($resultArr as $key => $value) {
$param["agent_id"] = $value["id"];
$param["is_del"] = 0;
$param["total_time"] = $total_time;
$total_time_arr = $this->tAgentTotalModel->getTotalEndTimeByAgentId("id,total_time", $param);
$id = 0;
if (count($total_time_arr) > 0) {
$id = $total_time_arr[0]["id"];
}
$agent_id = empty($value["id"]) ? 0 : $value["id"];
$district_id = empty($value["district_id"]) ? 0 : $value["district_id"];
$store_id = empty($value["store_id"]) ? 0 : $value["store_id"];
//todo 查询时间段的数据
$result = $this->selectTotal($agent_id, $district_id, $store_id, $start_total_time, $end_total_time);
if (empty($result)) continue;
if ($id > 0) {
$result["id"] = $id;
unset($result["create_time"]);
array_push($updateArr, $result);
} else {
array_push($insertArr, $result);
}
unset($result);
}
if (count($insertArr) > 0) {
$this->tAgentTotalModel->addTotal($insertArr);
}
if (count($updateArr) > 0) {
$this->tAgentTotalModel->saveTotal($updateArr);
}
}
/* public function test()
{
$params = $this->selectTotal(1, 1, 1, "2018-02-02", "2018-03-15");
$this->tAgentTotalModel->addTotal($params);
// dump($params);
}*/
private function selectTotal($agent_id, $district_id, $store_id, $start_total_time, $end_total_time)
{
//todo 如果查询出这个时间段都为0 则给此经纪人插入条最后一个日期的为空的数据
$result_arr = [];
//房源
$params["agent_id"] = $agent_id;
$params['create_time'] = array( 'between', array( $start_total_time, $end_total_time ) );
$addHouseNum = $this->houseModel->getAddHouseNumGroupTimeNew($params);
$result_arr["house_num"] = $addHouseNum[0]["num"];
//dump($addHouseNum);
//客源
$addUserNum = $this->userModel->getAddUserNumGroupTimeNew($params);
$result_arr["user_num"] = $addUserNum[0]["num"];
//dump($addUserNum);
//业绩
$performanceSum = $this->bargainModel->getAddBargainNumGroupTimeNew($params, 1);//1表示业绩 2表示实收
// dump($performanceSum);
$result_arr["performance_sum"] = $performanceSum[0]["num"];
//实收
$receivedSum = $this->bargainModel->getReceivedGroupTimeNew($params);
$result_arr["received_sum"] = $receivedSum[0]["num"];
//dump($receivedSum);
//约带看
$reportNum = $this->reportModel->getAddReportNumGroupTimeNew($params);
$result_arr["report_num"] = $reportNum[0]["num"];
//dump($reportNum);
//进场
$addMarchInNum = $this->marchInModel->getAddMarchInNumGroupTimeNew($params);
$result_arr["addMarch_in_num"] = $addMarchInNum[0]["num"];
//dump($addMarchInNum);
//收款
$payLogNum = $this->payLogModel->getAddPayLogNumGroupTimeNew($params);
$result_arr["pay_log_num"] = $payLogNum[0]["num"];
//dump($payLogNum);
// 监督
$supervision_num = $this->superviseModel->getAddPayLogNumGroupTimeNew($params);
$result_arr["supervision_num"] = $supervision_num[0]["num"];
//成交报告
$bargainSum = $this->bargainModel->getAddBargainNumGroupTimeNew($params, 3);//表示统计
$result_arr["bargain_sum"] = $bargainSum[0]["num"];
return $this->binAgentModel($agent_id, $district_id, $store_id, $result_arr, $start_total_time);
}
private function binAgentModel($agent_id, $district_id, $store_id, $result_arr, $start_total_time)
{
$params = [];
if (!empty($result_arr["house_num"]) || !empty($result_arr["user_num"]) || !empty($result_arr["performance_sum"]) ||
!empty($result_arr["received_sum"]) || !empty($result_arr["report_num"]) || !empty($result_arr["addMarch_in_num"]) ||
!empty($result_arr["pay_log_num"]) || !empty($result_arr["supervision_num"]) || !empty($result_arr["bargain_sum"])) {
$params["district_id"] = $district_id;
$params["store_id"] = $store_id;
$params["agent_id"] = $agent_id;
$params["total_time"] = $start_total_time;
$params["create_time"] = date("Y-m-d H:i:s", time());
$params["update_time"] = date("Y-m-d H:i:s", time());
$params["add_house_num"] = !empty($result_arr["house_num"]) ? $result_arr["house_num"] : 0;
$params["add_user_num"] = !empty($result_arr["user_num"]) ? $result_arr["user_num"] : 0;
$params["performance"] = !empty($result_arr["performance_sum"]) ? $result_arr["performance_sum"] : 0;
$params["official_receipts"] = !empty($result_arr["received_sum"]) ? $result_arr["received_sum"] : 0;
$params["look_at_num"] = !empty($result_arr["report_num"]) ? $result_arr["report_num"] : 0;
$params["march_in_num"] = !empty($result_arr["addMarch_in_num"]) ? $result_arr["addMarch_in_num"] : 0;
$params["paylog"] = !empty($result_arr["pay_log_num"]) ? $result_arr["pay_log_num"] : 0;
$params["supervision_num"] = !empty($result_arr["supervision_num"]) ? $result_arr["supervision_num"] : 0;
$params["bargain_sum"] = !empty($result_arr["bargain_sum"]) ? $result_arr["bargain_sum"] : 0;
}
unset($result_arr);
return $params;
}
}
\ No newline at end of file
......@@ -827,18 +827,36 @@ define(['doT', 'text!temp/remark_follow_template_tpl.html', 'ckfinder', 'ckfinde
params.remark_phone = $.trim($("#remark_phone").val());
params.remark_store_id = $.trim($("#guest_stores").val());
params.remark_district_id = $.trim($("#district_id").val());
if(params.remark_name.length == 1){
alert('跟进人姓名的搜索必须2字及2字以上');
return;
}
if($('#user_city_choose').val() == 310100){//城市
params.city = '上海市';
}
if($('#user_city_choose').val() == 330100){
params.city = '杭州市';
}
params.user_id = $.trim($("#customer_name_id").val());//区域
params.disc = $.trim($("#user_area_choose").val());//区域
_startDateObj.val() != '' && (params.start_date = _startDateObj.val());
_endDateObj.val() != '' && (params.end_date = _endDateObj.val());
$.trim(_customerNameObj.val()) != '' && (params.customer = $.trim(_customerNameObj.val()));
$.trim(_customerPhoneObj.val()) != '' && (params.phone = $.trim(_customerPhoneObj.val()));
$.trim(_followContentObj.val()) != '' && (params.content = $.trim(_followContentObj.val()));
//
var start_ = params.start_date+" 00:00:00";
date_start =new Date(Date.parse(start_.replace(/-/g, "/")));
var start_time =date_start.getTime();
var end_ = params.end_date+" 00:00:00";
date_end =new Date(Date.parse(end_.replace(/-/g, "/")));
var end_time =date_end.getTime();
var cha_time=end_time-start_time;
if(cha_time > 2678400000){
alert("跟进时间搜索控制在30天以内");
return;
}
$.ajax({
type: 'GET',
......
......@@ -207,6 +207,12 @@ define(['doT', 'text!temp/followHouseUp_template_tpl.html', 'css!style/home.css'
return;
}
var cha_time=params.end_time*1000-params.start_time*1000;
if(cha_time > 2764800000){
alert("跟进时间搜索控制在30天以内");
return;
}
$.ajax({
type: 'POST',
url: '/broker/houseFollowUpList', //商铺跟进 对接接口
......
......@@ -11,6 +11,7 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'css!style/h
store_id_Two: 0,//二级门店id
is_today_yeji:0,//默认搜索的不是今天 传参数0
panfangData: null,
orderList:0,
init: function() {
//初始化dot
$(document.body).append(template);
......@@ -81,6 +82,20 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'css!style/h
realtime.is_today_yeji=0;
realtime.getList(1); //一级审核搜索
});
//正序
_doc.on('click', '.positive-sequence-yeji', function(e) {
e.preventDefault();
e.stopPropagation();
realtime.orderList=1;
realtime.getList(1);
});
//倒序
_doc.on('click', '.reverse-order-yeji', function(e) {
e.preventDefault();
e.stopPropagation();
realtime.orderList=0;
realtime.getList(1);
});
//搜索的重置
$("#maintable_reset").click(function() {
......@@ -140,7 +155,12 @@ define(['doT', 'text!temp/real_time_performance_template_tpl.html', 'css!style/h
var tpl=realtime.switchTpl();
console.log(tpl);
var doTtmpl = doT.template(document.getElementById(tpl).innerHTML);
$("#maintable_list").html(doTtmpl(data.data));
if(realtime.orderList==0){
$("#maintable_list").html(doTtmpl(data.data.list.slice(0,19)));
}
if(realtime.orderList==1){
$("#maintable_list").html(doTtmpl(data.data.list.reverse().slice(0,19)));
}
//获取统计时间
$('#rank_start_day').html(data.data.start_time);
$('#rank_end_day').html(data.data.end_time);
......
......@@ -279,11 +279,12 @@ define(['doT', 'text!temp/reportList_template_tpl.html', 'css!style/home.css', '
_doc.on('click', '#maid_ok_btn', function(e){
e.preventDefault();
e.stopPropagation();
if(bargain.mainTabIndex === 2){
bargain.maidConfirmOk(1);
}else{
alert('财务第三级审核人员才能确认分佣!');
}
bargain.maidConfirmOk(1);
// if(bargain.mainTabIndex === 2){
// bargain.maidConfirmOk(1);
// }else{
// alert('财务第三级审核人员才能确认分佣!');
// }
});
//详情弹出框,分佣提成里,点击保存触发的事件
......
<!--部门业绩排行-->
<script id="realtimePerformance_list_tpl_one" type="text/template">
[% if(it["list"] && it["list"].length && it["list"].length>0) { %]
[% if(it && it.length && it.length>0) { %]
<tr class="maintable-tr-bar">
<th class="text-center">排名</th>
<th class="text-center">部门</th>
<th class="text-center">业绩(元)</th>
<th class="text-center">业绩(元)<span class="glyphicon glyphicon-triangle-bottom positive-sequence-yeji"></span><span class="glyphicon glyphicon-triangle-top reverse-order-yeji"></span></th>
<th class="text-center">成交单数</th>
<!--<th class="text-center">成交报告(其他)</th>-->
<th class="text-center">收款数</th>
<th class="text-center">进场数</th>
<th class="text-center">报备数</th>
......@@ -14,21 +13,20 @@
<th class="text-center">新增客户</th>
<th class="text-center">团队人数</th>
</tr>
[% for(var item in it["list"]){ %]
<tr data-id="[%= it['list'][item]['district_id'] %]">
<td class="text-center">[%= it["list"][item]['index_'] %]</td>
[% for(var item in it){ %]
<tr data-id="[%= it[item]['district_id'] %]">
<td class="text-center">[%= it[item]['index_'] %]</td>
<td class="text-center">
<a class="store-ranking" href="#modal-store" data-toggle="modal" data-id="[%= it['list'][item]['district_id'] %]">[%= it["list"][item]['district_name']+'-'+it["list"][item]['name'] %]</a>
<a class="store-ranking" href="#modal-store" data-toggle="modal" data-id="[%= it[item]['district_id'] %]">[%= it[item]['district_name']+'-'+it[item]['name'] %]</a>
</td>
<td class="text-center">[%= it["list"][item]['performance_total'] %]</td>
<td class="text-center">[%= it["list"][item]['bargain_sum_total'] %]</td>
<!--<td class="text-center">[%= it["list"][item]['bargain_sum'] %]</td>-->
<td class="text-center">[%= it["list"][item]['paylog_total'] %]</td>
<td class="text-center">[%= it["list"][item]['march_in_num_total'] %]</td>
<td class="text-center">[%= it["list"][item]['look_at_num_total'] %]</td>
<td class="text-center">[%= it["list"][item]['add_house_num_total'] %]</td>
<td class="text-center">[%= it["list"][item]['add_user_num_total'] %]</td>
<td class="text-center">[%= it["list"][item]['team_num'] %]</td>
<td class="text-center">[%= it[item]['performance_total'] %]</td>
<td class="text-center">[%= it[item]['bargain_sum_total'] %]</td>
<td class="text-center">[%= it[item]['paylog_total'] %]</td>
<td class="text-center">[%= it[item]['march_in_num_total'] %]</td>
<td class="text-center">[%= it[item]['look_at_num_total'] %]</td>
<td class="text-center">[%= it[item]['add_house_num_total'] %]</td>
<td class="text-center">[%= it[item]['add_user_num_total'] %]</td>
<td class="text-center">[%= it[item]['team_num'] %]</td>
</tr>
[% } %]
......@@ -41,13 +39,12 @@
<!--门店业绩排行-->
<script id="realtimePerformance_list_tpl_two" type="text/template">
[% if(it["list"] && it["list"].length && it["list"].length>0) { %]
[% if(it && it.length && it.length>0) { %]
<tr class="maintable-tr-bar">
<th class="text-center">排名</th>
<td class="text-center">门店</td>
<th class="text-center">业绩(元)</th>
<th class="text-center">业绩(元)<span class="glyphicon glyphicon-triangle-bottom positive-sequence-yeji"></span><span class="glyphicon glyphicon-triangle-top reverse-order-yeji"></span></th>
<th class="text-center">成交单数</th>
<!--<th class="text-center">成交报告(其他)</th>-->
<th class="text-center">收款数</th>
<th class="text-center">进场数</th>
<th class="text-center">报备数</th>
......@@ -55,21 +52,20 @@
<th class="text-center">新增客户</th>
<th class="text-center">团队人数</th>
</tr>
[% for(var item in it["list"]){ %]
[% for(var item in it){ %]
<tr>
<td class="text-center">[%= it["list"][item]['index_'] %]</td>
<td class="text-center">[%= it[item]['index_'] %]</td>
<td class="text-center">
<a class="agent-ranking" href="#modal-agent" data-toggle="modal" data-id="[%= it['list'][item]['store_id'] %]">[%= it["list"][item]['district_name']+'-'+it["list"][item]['store_name']+'-'+it["list"][item]['name'] %]</a>
<a class="agent-ranking" href="#modal-agent" data-toggle="modal" data-id="[%= it[item]['store_id'] %]">[%= it[item]['district_name']+'-'+it[item]['store_name']+'-'+it[item]['name'] %]</a>
</td>
<td class="text-center">[%= it["list"][item]['performance_total'] %]</td>
<td class="text-center">[%= it["list"][item]['bargain_sum_total'] %]</td>
<!--<td class="text-center">[%= it["list"][item]['bargain_sum'] %]</td>-->
<td class="text-center">[%= it["list"][item]['paylog_total'] %]</td>
<td class="text-center">[%= it["list"][item]['march_in_num_total'] %]</td>
<td class="text-center">[%= it["list"][item]['look_at_num_total'] %]</td>
<td class="text-center">[%= it["list"][item]['add_house_num_total'] %]</td>
<td class="text-center">[%= it["list"][item]['add_user_num_total'] %]</td>
<td class="text-center">[%= it["list"][item]['team_num'] %]</td>
<td class="text-center">[%= it[item]['performance_total'] %]</td>
<td class="text-center">[%= it[item]['bargain_sum_total'] %]</td>
<td class="text-center">[%= it[item]['paylog_total'] %]</td>
<td class="text-center">[%= it[item]['march_in_num_total'] %]</td>
<td class="text-center">[%= it[item]['look_at_num_total'] %]</td>
<td class="text-center">[%= it[item]['add_house_num_total'] %]</td>
<td class="text-center">[%= it[item]['add_user_num_total'] %]</td>
<td class="text-center">[%= it[item]['team_num'] %]</td>
</tr>
[% } %]
[% }else{ %]
......@@ -81,31 +77,29 @@
<!--个人业绩排行-->
<script id="realtimePerformance_list_tpl_three" type="text/template">
[% if(it["list"] && it["list"].length && it["list"].length>0) { %]
[% if(it && it.length && it.length>0) { %]
<tr class="maintable-tr-bar">
<th class="text-center">排名</th>
<th class="text-center">经纪人</th>
<th class="text-center">业绩(元)</th>
<th class="text-center">业绩(元)<span class="glyphicon glyphicon-triangle-bottom positive-sequence-yeji"></span><span class="glyphicon glyphicon-triangle-top reverse-order-yeji"></span></th>
<th class="text-center">成交单数</th>
<!--<th class="text-center">成交报告(其他)</th>-->
<th class="text-center">收款数</th>
<th class="text-center">进场数</th>
<th class="text-center">报备数</th>
<th class="text-center">新增商铺</th>
<th class="text-center">新增客户</th>
</tr>
[% for(var item in it["list"]){ %]
<tr data-id="[%= it['list'][item]['id'] %]" data-orderid="[%= it['list'][item]['order_id'] %]">
<td class="text-center">[%= it["list"][item]['index_'] %]</td>
<td class="text-center">[%= it["list"][item]['district_name']+'-'+it["list"][item]['store_name']+'-'+it["list"][item]['name'] %]</a></td>
<td class="text-center">[%= it["list"][item]['performance_total'] %]</td>
<td class="text-center">[%= it["list"][item]['bargain_sum_total'] %]</td>
<!--<td class="text-center">[%= it["list"][item]['bargain_sum'] %]</td>-->
<td class="text-center">[%= it["list"][item]['paylog_total'] %]</td>
<td class="text-center">[%= it["list"][item]['march_in_num_total'] %]</td>
<td class="text-center">[%= it["list"][item]['look_at_num_total'] %]</td>
<td class="text-center">[%= it["list"][item]['add_house_num_total'] %]</td>
<td class="text-center">[%= it["list"][item]['add_user_num_total'] %]</td>
[% for(var item in it){ %]
<tr data-id="[%= it[item]['id'] %]" data-orderid="[%= it[item]['order_id'] %]">
<td class="text-center">[%= it[item]['index_'] %]</td>
<td class="text-center">[%= it[item]['district_name']+'-'+it[item]['store_name']+'-'+it[item]['name'] %]</a></td>
<td class="text-center">[%= it[item]['performance_total'] %]</td>
<td class="text-center">[%= it[item]['bargain_sum_total'] %]</td>
<td class="text-center">[%= it[item]['paylog_total'] %]</td>
<td class="text-center">[%= it[item]['march_in_num_total'] %]</td>
<td class="text-center">[%= it[item]['look_at_num_total'] %]</td>
<td class="text-center">[%= it[item]['add_house_num_total'] %]</td>
<td class="text-center">[%= it[item]['add_user_num_total'] %]</td>
</tr>
[% } %]
[% }else{ %]
......@@ -115,6 +109,9 @@
[% } %]
</script>
<!--门店业绩 详情-->
<script id="store_list_tpl" type="text/template">
[% if(it["list"] && it["list"].length && it["list"].length>0) { %]
......
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