Commit 21807c3b authored by zhuwei's avatar zhuwei

业绩排行修改

parent f6a0dc31
...@@ -35,7 +35,7 @@ class PerformanceInfo extends Basic ...@@ -35,7 +35,7 @@ class PerformanceInfo extends Basic
$pageNo = empty($this->params['pageNo']) ? 1 : $this->params['pageNo']; $pageNo = empty($this->params['pageNo']) ? 1 : $this->params['pageNo'];
$pageSize = empty($this->params['pageSize']) ? 15 : $this->params['pageSize']; $pageSize = empty($this->params['pageSize']) ? 15 : $this->params['pageSize'];
$where['Obargain.status'] = ['in', '10,11,13']; $where['Obargain.status'] = array('neq',30);
/*开始结束时间*/ /*开始结束时间*/
if (($this->params['create_time_start'] != NULL) && ($this->params['create_time_end'] != NULL)) { if (($this->params['create_time_start'] != NULL) && ($this->params['create_time_end'] != NULL)) {
$where['Obargain.create_time'] = ['between time', [$this->params['create_time_start']. ' 00:00:00', $this->params['create_time_end'] . ' 23:59:59']]; $where['Obargain.create_time'] = ['between time', [$this->params['create_time_start']. ' 00:00:00', $this->params['create_time_end'] . ' 23:59:59']];
...@@ -133,7 +133,7 @@ class PerformanceInfo extends Basic ...@@ -133,7 +133,7 @@ class PerformanceInfo extends Basic
public function getPerformanceInfoExcel() public function getPerformanceInfoExcel()
{ {
$where['Obargain.status'] = ['in', '10,11,13']; $where['Obargain.status'] = array('neq',30);
/*开始结束时间*/ /*开始结束时间*/
if (($this->params['create_time_start'] != NULL) && ($this->params['create_time_end'] != NULL)) { if (($this->params['create_time_start'] != NULL) && ($this->params['create_time_end'] != NULL)) {
$where['Obargain.create_time'] = ['between time', [$this->params['create_time_start']. ' 00:00:00', $this->params['create_time_end'] . ' 23:59:59']]; $where['Obargain.create_time'] = ['between time', [$this->params['create_time_start']. ' 00:00:00', $this->params['create_time_end'] . ' 23:59:59']];
......
...@@ -527,6 +527,45 @@ class AAgents extends BaseModel ...@@ -527,6 +527,45 @@ class AAgents extends BaseModel
->join("a_district c", "a.district_id = c.id", "left") ->join("a_district c", "a.district_id = c.id", "left")
->where($where_) ->where($where_)
->select(); ->select();
//echo $this->getLastSql();
return $result;
}
/**
* 查询经纪人信息-业绩排行用
* @param $field
* @param $params
* @return false|\PDOStatement|string|\think\Collection
*/
public function getAgentsInfoByAgentIdForPerformanceService($field, $params)
{
$where_ = [];
if (isset($params["agent_id"])) {
$where_["a.id"] = $params["agent_id"];
}
if (isset($params["phone"])) {
$where_["a.phone"] = $params["phone"];
}
if (isset($params["store_id"])) {
$where_["b.id"] = $params["store_id"];
$where_["a.level"] = array( "in", "20,40" );
}
if (isset($params["district_id"])) {
$where_["c.id"] = $params["district_id"];
$where_["a.level"] = array( "in", "30,40" );
}
$result = Db::table($this->table)
->field($field)
->alias("a")
->join("a_store b", "a.store_id = b.id", "left")
->join("a_district c", "a.district_id = c.id", "left")
->where($where_)
->select();
//echo $this->getLastSql();
return $result; return $result;
} }
......
...@@ -259,4 +259,20 @@ class AStore extends BaseModel ...@@ -259,4 +259,20 @@ class AStore extends BaseModel
->where($where) ->where($where)
->find(); ->find();
} }
/**
* 获取门店
* @param $params
* @return false|\PDOStatement|string|\think\Collection
*/
public function getStore($params,$field)
{
$result = $this
->field($field)
->where($params)
->select();
//echo Db::table($this->table)->getLastSql();
//dump($this->getLastSql());
return $result;
}
} }
\ No newline at end of file
...@@ -1411,7 +1411,7 @@ class OBargainModel extends Model ...@@ -1411,7 +1411,7 @@ class OBargainModel extends Model
->limit($pageSize) ->limit($pageSize)
->page($pageNo) ->page($pageNo)
->select(); ->select();
//echo $this->db_->getLastSql(); echo $this->db_->getLastSql();
return $result; return $result;
} }
......
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