Commit d5c61163 authored by zw's avatar zw

优化下

parent 24bb5e8f
...@@ -541,6 +541,7 @@ class AppChat extends Basic ...@@ -541,6 +541,7 @@ class AppChat extends Basic
} }
$param["addressee_id"] = $params["agent_id"]; $param["addressee_id"] = $params["agent_id"];
$param["is_read"] = 0;
$param["type"] = 2; $param["type"] = 2;
//TODO 获取未读个数 //TODO 获取未读个数
$data["user_count"] = $msgModel->getListCountByWhere($param); $data["user_count"] = $msgModel->getListCountByWhere($param);
...@@ -564,7 +565,8 @@ class AppChat extends Basic ...@@ -564,7 +565,8 @@ class AppChat extends Basic
} }
//todo 先获取是否有店铺或客户修改消息是否为0,大于0返回true,否则查询聊天消息是否有未读 //todo 先获取是否有店铺或客户修改消息是否为0,大于0返回true,否则查询聊天消息是否有未读
$param["addressee_id"] = $params["agent_id"]; $param["addressee_id"] = $params["agent_id"];
$param["type"] = 2; $param["type"] = 2;
$param["is_read"] = 0;
//TODO 获取未读个数 //TODO 获取未读个数
$msgModel = new MPushMessage(); $msgModel = new MPushMessage();
$user_count = $msgModel->getListCountByWhere($param); $user_count = $msgModel->getListCountByWhere($param);
......
<?php
namespace app\index;
use app\api\service\RankingListService;
use app\index\extend\Basic;
use think\Request;
/**
* Created by PhpStorm.
* User : zw
* Date : 2018/11/12
* Time : 2:04 PM
* Intro: pk榜
*/
class RankingList extends Basic{
private $service_;
public function __construct(Request $request = null)
{
parent::__construct($request);
$this->service_ = new RankingListService();
}
public function getRandKingList(){
$siteId = $this->siteId;
$this->service_->RankingList(0,$siteId);
}
}
\ No newline at end of file
<?php
namespace app\api\service;
use app\model\AAgents;
use app\model\TAgentTotalModel;
/**
* Created by PhpStorm.
* User : zw
* Date : 2018/11/12
* Time : 2:06 PM
* Intro:
*/
class RankingListService
{
private $agentModel;
private $agentTotalModel;
public function __construct()
{
$this->agentModel = new AAgents();
$this->agentTotalModel = new TAgentTotalModel();
}
public function RankingList($position, $siteId)
{
//todo 1.查询出此职称的经纪人 获取10月份某个职称的排行 职称 1店长 2经理 3主任 4顾问 0新人
//todo 2.根据上月的业绩排行获取本月业绩排行,
//todo 3.根据此职称的总经纪人数分组
$fields = "id,store_id,district_id";
$params["site_id"] = $siteId;
$params["position"] = $position;
$params["status"] = array("in", "0,3");
$resultArr = $this->agentModel->getAgentsListByPK($fields, $params);
if (count($resultArr) <= 0) {
return false;
}
$ids = "";
foreach ($resultArr as $item) {
$ids .= $item["id"] . ",";
}
$ids = rtrim($ids, ",");
$this->agentTotalModel->getSortPerformance();
}
}
\ No newline at end of file
...@@ -409,6 +409,23 @@ class AAgents extends BaseModel ...@@ -409,6 +409,23 @@ class AAgents extends BaseModel
->select(); ->select();
} }
/**
* @param string $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 getAgentsListByPK( $field = "id",$params)
{
$params["district_id"] = array( 'not in', array( '13', '14', '15' ) );
return Db::table($this->table)
->field($field)
->where($params)
->select();
}
/** /**
* 获取经纪人列表--排掉店子和总监 * 获取经纪人列表--排掉店子和总监
* *
......
...@@ -313,4 +313,8 @@ class TAgentTotalModel extends Model ...@@ -313,4 +313,8 @@ class TAgentTotalModel extends Model
return $result; return $result;
} }
public function getSortPerformance(){
}
} }
\ 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