Commit 4bacfde5 authored by clone's avatar clone

bug

parent ec39334b
......@@ -43,13 +43,14 @@ class OrderLog extends Basic
{
$params = $this->params;
if (!isset($params["march_in_area"]) || !isset($params["report_id"]) || !isset($params["reception_id"])
if (!isset($params["march_in_area"]) || !isset($params["report_id"]) || !isset($params["reception_id"]) || !isset($params["reception_name"])
|| !isset($params["order_id"]) || !isset($params["order_no"])) {
return $this->response("101", "请求参数错误");
}
/* $params = array(
"reception_id" => 1,//带看经纪人id
"reception_name" => 1,//带看经纪人id
"report_id" => 1,//报备id
"order_id" =>1, //关联order表id
"order_no" =>"123123123123123", //订单no
......
......@@ -85,13 +85,13 @@ class Report extends Basic
*/
public function reportList()
{
/* $params = array(
/* $params = array(
"agent_id" =>1,
"type" => 1,//1表示全部 2表示进场 3 表示收款 4成交报告
"page_no"=>1,
"page_size"=>15
);*/
$params = $this->params;
$params = $this->params;
if (!isset($params["agent_id"]) || !isset($params["type"])) {
return $this->response("101", "请求参数错误");
......@@ -100,7 +100,7 @@ class Report extends Basic
$pageNo = empty($params['page_no']) ? 1 : $params['page_no'];
$pageSize = empty($params['page_size']) ? 15 : $params['page_size'];
$field = "a.id,a.user_id,a.user_phone,a.user_name,a.predict_see_time,b.id as order_id,b.order_no,b.house_id,b.house_title";
$field = "a.id,a.user_id,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"];
$result = $this->service_->orderList($field, $params, $pageNo, $pageSize);
......
......@@ -128,7 +128,8 @@ class OReportModel extends Model
AND `b`.`is_del` = 0
GROUP BY
`c`.`order_id`
) ) AS aaa LIMIT $start_index,$pageSize";
) ) AS aaa ORDER BY `create_time` DESC LIMIT $start_index,$pageSize";
$result = $this->db->query($sql);
return $result;
......@@ -164,7 +165,7 @@ class OReportModel extends Model
GROUP BY
`c`.`order_id`
)
) AS aaa LIMIT $start_index,$pageSize";
) AS aaa ORDER BY `create_time` DESC LIMIT $start_index,$pageSize";
$result = $this->db->query($sql);
return $result;
......@@ -199,7 +200,7 @@ class OReportModel extends Model
GROUP BY
`c`.`order_id`
)
) AS aaa limit $start_index,$pageSize";
) AS aaa ORDER BY `create_time` DESC limit $start_index,$pageSize";
$result = $this->db->query($sql);
return $result;
default:
......@@ -223,7 +224,7 @@ class OReportModel extends Model
`b`.`house_id` IN ($house_ids)
AND `a`.`status` = 0
AND `b`.`is_del` = 0
) ) as aaa limit $start_index,$pageSize";
) ) as aaa ORDER BY `create_time` DESC limit $start_index,$pageSize";
$result = $this->db->query($sql);
return $result;
......@@ -347,14 +348,15 @@ class OReportModel extends Model
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function getAgentByReportId($report_id) {
public function getAgentByReportId($report_id)
{
$user_id = $this->db->field('user_id')
->where('id',$report_id)
->where('id', $report_id)
->value('user_id');
$user = new Users();
$agent_id = $user->where('id',$user_id)->value('agent_id');
$agent_data = $this->db->table('a_agents')->field('id,device_id')->where('id',$agent_id)->find();
$user = new Users();
$agent_id = $user->where('id', $user_id)->value('agent_id');
$agent_data = $this->db->table('a_agents')->field('id,device_id')->where('id', $agent_id)->find();
return $agent_data;
}
}
\ 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