Commit cbe14f8a authored by hujun's avatar hujun

Merge branch '0716-v.2.4.0' into chat_0705

parents b54fcfa3 8687bd53
...@@ -465,7 +465,7 @@ class Broker extends Basic ...@@ -465,7 +465,7 @@ class Broker extends Basic
}*/ }*/
$user = new Users(); $user = new Users();
$user_res = $user->useraction_search_user_res($user_id); $user_res = $user->useraction_search_user_res($user_id,1);
$user_res['user_pic'] = HEADERIMGURL . $user_res['user_pic']; $user_res['user_pic'] = HEADERIMGURL . $user_res['user_pic'];
......
...@@ -132,8 +132,9 @@ class CollectHouse extends Basic ...@@ -132,8 +132,9 @@ class CollectHouse extends Basic
$res = $this->aCollectHouse->getCollectList($pageNo,$pageSize,$field,$get_params); $res = $this->aCollectHouse->getCollectList($pageNo,$pageSize,$field,$get_params);
$look_shop_service = new LookShopService(); $look_shop_service = new LookShopService();
foreach ($res as $key => $val) { foreach ($res as $key => $val) {
$isLook = $look_shop_service->isLooked($params["agents_id"], $val["id"]); $isLook = $look_shop_service->isLooked($params["agents_id"], $val["id"]);
$res[$key]["is_look"] = $isLook; $res[$key]["is_look"] = $isLook;
$res[$key]["rent_price"] = $val["rent_price"] * 0.01;
} }
//dump($res); //dump($res);
......
...@@ -123,22 +123,27 @@ class Report extends Basic ...@@ -123,22 +123,27 @@ class Report extends Basic
*/ */
public function reportListForPc() public function reportListForPc()
{ {
/* $params = array(
"agent_id" =>10013,
"type" => 1,//1表示全部 2表示进场 3 表示收款 4成交报告
"page_no"=>1,
"page_size"=>15
);*/
$params = $this->params;
$params = $this->params;
/*$params = array(
"AuthToken" =>'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJkYXRhIjp7ImlkIjoxLCJuYW1lIjoiXHU3YmExXHU3NDA2XHU1NDU4MTEiLCJwaG9uZSI6InJvb3QiLCJsZXZlbCI6MTB9LCJ0aW1lU3RhbXBfIjoxNTMxODA3NTAxfQ.zQp_zyCknWsdJbmNvsFOzuuq-C_zeUijYUWomBHeIFU',
"agent_id" =>1,
"type" => 1,//1表示全部 2表示进场 3 表示收款 4成交报告
"page_no"=>0,
"page_size"=>15,
"create_time_start"=>'2018-07-13',
"create_time_end"=>'2018-07-13',
"district_id"=>5,
);*/
if (!isset($params["agent_id"]) || !isset($params["type"])) { if (!isset($params["agent_id"]) || !isset($params["type"])) {
return $this->response("101", "请求参数错误"); return $this->response("101", "请求参数错误");
} }
$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.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.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"];
......
...@@ -28,7 +28,7 @@ class VerifyService ...@@ -28,7 +28,7 @@ class VerifyService
*/ */
public function getAgentsByAgentId($agent_id) public function getAgentsByAgentId($agent_id)
{ {
$params["id"] = $agent_id; $params["id"] = $agent_id;
$result = $this->agentModel->searchAgentsByKeyword("id,store_id,district_id,level", $params); $result = $this->agentModel->searchAgentsByKeyword("id,store_id,district_id,level", $params);
if (count($result) > 0) { if (count($result) > 0) {
$arr_list = []; $arr_list = [];
......
<?php <?php
namespace app\api_broker\service; namespace app\api_broker\service;
use app\model\AAgents; use app\model\AAgents;
use app\model\AuthGroup; use app\model\AuthGroup;
use app\model\AuthRule; use app\model\AuthRule;
/** /**
* Created by PhpStorm. * Created by PhpStorm.
* User: zhuwei * User: zhu wei
* Date: 2018-07-10 * Date: 2018-07-10
* Time: 17:09:38 * Time: 17:09:38
*/ */
class VipService class VipService
{ {
/** /**
* 是否具有查看vip客户权限 * 是否具有查看vip客户权限
* * @param $id int 经纪人ID
* @return int 是否可以查看vip客户 0:可查看 1:不可查看
*/ */
public function vip($id) public function vip($id)
{ {
//$id= 5743; //$id= 5743;
$agent = new AAgents(); $agent = new AAgents();
$fields='auth_group_id'; $fields = 'auth_group_id';
$auth_group_id = $agent->getAgentsById($id, $fields); $auth_group_id = $agent->getAgentsById($id, $fields);
$auth_group = New AuthGroup(); $auth_group = New AuthGroup();
$id= $auth_group_id; $id = $auth_group_id;
$fields='rules'; $fields = 'rules';
$rules = $auth_group->getAuthGroupById($id, $fields); $rules = $auth_group->getAuthGroupById($id, $fields);
$auth_group = New AuthRule(); $auth_group = New AuthRule();
$name= 'auth_vip'; $name = 'auth_vip';
$fields='id'; $fields = 'id';
$sauth_ruel_id = $auth_group->getAuthRuleByName($name, $fields); $auth_rule_id = $auth_group->getAuthRuleByName($name, $fields);
$rules_arr = explode(',',$rules); $rules_arr = explode(',', $rules);
//dump($rules_arr); //dump($rules_arr);
if (in_array($sauth_ruel_id, $rules_arr)) { if (in_array($auth_rule_id, $rules_arr)) {
return 0; return 0;
} else { } else {
return 1; return 1;
...@@ -51,6 +52,4 @@ class VipService ...@@ -51,6 +52,4 @@ class VipService
} }
} }
\ No newline at end of file
...@@ -178,6 +178,36 @@ class OReportModel extends Model ...@@ -178,6 +178,36 @@ class OReportModel extends Model
$house_ids = $params["house_ids"]; $house_ids = $params["house_ids"];
} }
//todo 约带看时间 开始 结束
if (!empty($params['create_time_start']) && !empty($params['create_time_end'])) {
$conditions[] = "aaa.create_time BETWEEN '".$params['create_time_start']. " 00:00:00' AND '" .$params['create_time_end'] . " 23:59:59'";
}
//todo 约带看人姓名
if (!empty($params['report_agent_name'])) {
$conditions[] = "aaa.report_agent_name LIKE '%".$params['name']."%'";
}
//todo 约带看人手机号
if (!empty($params['phone'])) {
$conditions[] = "aaa.phone LIKE '%".$params['phone']."%'";
}
//todo 商铺名
if (!empty($params['house_title'])) {
$conditions[] = "aaa.house_title LIKE '%".$params['house_title']."%'";
}
//todo 客户手机号
if (!empty($params['user_phone'])) {
$conditions[] = "aaa.user_phone LIKE '%".$params['user_phone']."%'";
}
#组装搜索where条件
if ($conditions) {
$where_params = 'WHERE ' . implode(" AND ", $conditions);
}
switch ($params["type"]) { switch ($params["type"]) {
case 2: case 2:
$sql = "SELECT * FROM $sql = "SELECT * FROM
...@@ -208,7 +238,6 @@ class OReportModel extends Model ...@@ -208,7 +238,6 @@ class OReportModel extends Model
`c`.`order_id` `c`.`order_id`
) ) AS aaa ORDER BY `create_time` DESC LIMIT $start_index,$pageSize"; ) ) AS aaa ORDER BY `create_time` DESC LIMIT $start_index,$pageSize";
$result = $this->db->query($sql); $result = $this->db->query($sql);
return $result; return $result;
case 3: case 3:
...@@ -302,7 +331,8 @@ class OReportModel extends Model ...@@ -302,7 +331,8 @@ class OReportModel extends Model
`b`.`house_id` IN ($house_ids) `b`.`house_id` IN ($house_ids)
AND `a`.`status` = 0 AND `a`.`status` = 0
AND `b`.`is_del` = 0 AND `b`.`is_del` = 0
) ) as aaa ORDER BY `create_time` DESC limit $start_index,$pageSize"; ) ) as aaa $where_params ORDER BY `create_time` DESC limit $start_index,$pageSize";
//var_dump($sql);
$result = $this->db->query($sql); $result = $this->db->query($sql);
...@@ -329,6 +359,34 @@ class OReportModel extends Model ...@@ -329,6 +359,34 @@ class OReportModel extends Model
$house_ids = $params["house_ids"]; $house_ids = $params["house_ids"];
} }
//todo 约带看时间 开始 结束
if (!empty($params['create_time_start']) && !empty($params['create_time_end'])) {
$conditions[] = "aaa.create_time BETWEEN '".$params['create_time_start']. " 00:00:00' AND '" .$params['create_time_end'] . " 23:59:59'";
}
//todo 约带看人姓名
if (!empty($params['report_agent_name'])) {
$conditions[] = "aaa.report_agent_name LIKE '%".$params['name']."%'";
}
//todo 约带看人手机号
if (!empty($params['phone'])) {
$conditions[] = "aaa.phone LIKE '%".$params['phone']."%'";
}
//todo 商铺名
if (!empty($params['house_title'])) {
$conditions[] = "aaa.house_title LIKE '%".$params['house_title']."%'";
}
//todo 客户手机号
if (!empty($params['user_phone'])) {
$conditions[] = "aaa.user_phone LIKE '%".$params['user_phone']."%'";
}
#组装搜索where条件
if ($conditions) {
$where_params = 'WHERE ' . implode(" AND ", $conditions);
}
switch ($params["type"]) { switch ($params["type"]) {
case 2: case 2:
$sql = "SELECT count(1) as total FROM $sql = "SELECT count(1) as total FROM
...@@ -453,7 +511,7 @@ class OReportModel extends Model ...@@ -453,7 +511,7 @@ class OReportModel extends Model
`b`.`house_id` IN ($house_ids) `b`.`house_id` IN ($house_ids)
AND `a`.`status` = 0 AND `a`.`status` = 0
AND `b`.`is_del` = 0 AND `b`.`is_del` = 0
) ) as aaa"; ) ) as aaa $where_params";
$result = $this->db->query($sql); $result = $this->db->query($sql);
......
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