Commit 7571e1b6 authored by zhuwei's avatar zhuwei

bug

parent 4970f9a5
...@@ -143,7 +143,7 @@ class Report extends Basic ...@@ -143,7 +143,7 @@ class Report extends Basic
$pageNo = empty($params['page_no']) ? 1 : $params['page_no']; $pageNo = empty($params['page_no']) ? 1 : $params['page_no'];
$pageSize = empty($params['page_size']) ? 15 : $params['page_size']; $pageSize = empty($params['page_size']) ? 15 : $params['page_size'];
$field = "a.id,a.user_id,a.report_agent_name,a.user_phone,a.user_name,a.predict_see_time,a.create_time,b.id as order_id,b.order_no,b.house_id,b.house_title"; $field = "a.id,a.user_id,a.report_agent_name,a.report_agent_phone,a.user_phone,a.user_name,a.predict_see_time,a.create_time,b.id as order_id,b.order_no,b.house_id,b.house_title";
$params["report_agent_id"] = $params["agent_id"]; $params["report_agent_id"] = $params["agent_id"];
......
...@@ -36,18 +36,21 @@ class Statement extends Basic ...@@ -36,18 +36,21 @@ class Statement extends Basic
header('Access-Control-Allow-Origin:*'); header('Access-Control-Allow-Origin:*');
$params = $this->params; $params = $this->params;
/*$params = array( /*$params = array(
"agent_id" => 5740, "agent_id" => 5739,//5739 总监 5740店长
"time_start" => date("Y-m-d", time()), "time_start" => date("Y-m-d", time()),
"time_end" => date("Y-m-d", time()) . " 23:59:59", "time_end" => date("Y-m-d", time()),
);*/ );*/
if (!isset($params["agent_id"]) || !isset($params["time_start"]) || !isset($params["time_end"])) { if (!isset($params["agent_id"]) || !isset($params["time_start"]) || !isset($params["time_end"])) {
return $this->response("101", "请求参数错误"); return $this->response("101", "请求参数错误");
} }
$day_or_week = $params["time_start"] == $params["time_end"] ? 'day' : 'week';
$time_end = $params["time_end"] . " 23:59:59"; $time_end = $params["time_end"] . " 23:59:59";
try { try {
$result = $this->service_->selectStatementByAgentId($params["agent_id"], $params["time_start"], $time_end); $result = $this->service_->selectStatementByAgentId($params["agent_id"], $params["time_start"], $time_end,$day_or_week);
if (count($result) > 0) { if (count($result) > 0) {
return $this->response("200", "request success", $result); return $this->response("200", "request success", $result);
......
...@@ -384,6 +384,7 @@ class AAgents extends BaseModel ...@@ -384,6 +384,7 @@ class AAgents extends BaseModel
->where($params) ->where($params)
->select(); ->select();
//echo Db::table($this->table)->getLastSql(); //echo Db::table($this->table)->getLastSql();
//dump($this->getLastSql());
return $result; return $result;
} }
...@@ -940,4 +941,25 @@ class AAgents extends BaseModel ...@@ -940,4 +941,25 @@ class AAgents extends BaseModel
} }
return $result; return $result;
} }
/**
* 获取经纪人数量
*
* @param $params
* @return false|\PDOStatement|string|\think\Collection
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getAgentsCountByStoreId($params)
{
$result = Db::table($this->table)
->field("id,name")
->where($params)
->count();
//echo Db::table($this->table)->getLastSql();
//dump($this->getLastSql());
return $result;
}
} }
\ No newline at end of file
...@@ -185,12 +185,12 @@ class OReportModel extends Model ...@@ -185,12 +185,12 @@ class OReportModel extends Model
//todo 约带看人姓名 //todo 约带看人姓名
if (!empty($params['report_agent_name'])) { if (!empty($params['report_agent_name'])) {
$conditions[] = "aaa.report_agent_name LIKE '%".$params['name']."%'"; $conditions[] = "aaa.report_agent_name LIKE '%".$params['report_agent_name']."%'";
} }
//todo 约带看人手机号 //todo 约带看人手机号
if (!empty($params['phone'])) { if (!empty($params['phone'])) {
$conditions[] = "aaa.phone LIKE '%".$params['phone']."%'"; $conditions[] = "aaa.report_agent_phone LIKE '%".$params['report_agent_phone']."%'";
} }
//todo 商铺名 //todo 商铺名
if (!empty($params['house_title'])) { if (!empty($params['house_title'])) {
...@@ -512,7 +512,7 @@ class OReportModel extends Model ...@@ -512,7 +512,7 @@ class OReportModel extends Model
AND `a`.`status` = 0 AND `a`.`status` = 0
AND `b`.`is_del` = 0 AND `b`.`is_del` = 0
) ) as aaa $where_params"; ) ) as aaa $where_params";
var_dump($sql);
$result = $this->db->query($sql); $result = $this->db->query($sql);
//echo $this->getLastSql(); //echo $this->getLastSql();
......
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