Commit d75689b9 authored by hujun's avatar hujun

Merge remote-tracking branch 'origin/wx0604' into wx0604

parents 90b541fa cdd1cf79
...@@ -105,15 +105,14 @@ class AppointmentTime extends Basic ...@@ -105,15 +105,14 @@ class AppointmentTime extends Basic
*/ */
public function getAppointmentSeeShopList() public function getAppointmentSeeShopList()
{ {
/* $params = array(
"status" => 2, //看铺状态 0待经纪人确认(确认后存agents_id) 1:待看 2:已看' 如果是待看 0,1 已看是2
"user_id" => "11142",//对应u_users表
"phone" => "13661753534",//phone
"pageNo" => "1",
"pageSize" => 15
);*/
$params = $this->params; $params = $this->params;
/* $params = array(
"status" => 1, //看铺状态 0待经纪人确认(确认后存agents_id) 1:待看 2:已看' 如果是待看 0,1 已看是2
"user_id" => "11142",//对应u_users表
"phone" => "13661753534",//phone
"pageNo" => "1",
"pageSize" => 15
);*/
if (!isset($params["status"])) { if (!isset($params["status"])) {
return $this->response("101", "请求状态不能为空"); return $this->response("101", "请求状态不能为空");
...@@ -212,11 +211,11 @@ class AppointmentTime extends Basic ...@@ -212,11 +211,11 @@ class AppointmentTime extends Basic
*/ */
public function getYetListV2($pageNo, $pageSize, $params) public function getYetListV2($pageNo, $pageSize, $params)
{ {
$field = "a.id,a.report_agent_phone as phone,a.report_agent_id as agents_id,a.predict_see_time as expect_time,b.house_id, $field = "a.id,a.report_agent_phone as phone,a.report_agent_id as agents_id,a.predict_see_time as expect_time,b.house_id,
d.external_title as house_title,d.residue_num as room_num_left"; d.external_title as house_title,d.residue_num as room_num_left";
$where_["a.user_id"] = $params["user_id"]; $where_["a.user_id"] = $params["user_id"];
// $result = $this->appointmentTimeModel->getHaveToSeeList($pageNo, $pageSize, "id desc", $field, $where_); // $result = $this->appointmentTimeModel->getHaveToSeeList($pageNo, $pageSize, "id desc", $field, $where_);
$result = $this->reportModel->getHaveToSeeList($pageNo, $pageSize, "id desc", $field, $where_); $result = $this->reportModel->getHaveToSeeList($pageNo, $pageSize, "id desc", $field, $where_);
//获取图片信息 //获取图片信息
foreach ($result as $key => $val) { foreach ($result as $key => $val) {
...@@ -243,9 +242,8 @@ class AppointmentTime extends Basic ...@@ -243,9 +242,8 @@ class AppointmentTime extends Basic
d.external_title as house_title,d.residue_num as room_num_left"; d.external_title as house_title,d.residue_num as room_num_left";
$where_["a.user_id"] = $params["user_id"]; $where_["user_id"] = $params["user_id"];
$where_["c.id"] = array('EXP','IS NULL'); $result = $this->reportModel->getWaitToSeeList($pageNo, $pageSize, "id desc", $field, $where_);
$result = $this->reportModel->getWaitToSeeList($pageNo, $pageSize, "id desc", $field, $where_);
//获取图片信息 //获取图片信息
foreach ($result as $key => $val) { foreach ($result as $key => $val) {
......
...@@ -83,7 +83,7 @@ class Register extends Basic ...@@ -83,7 +83,7 @@ class Register extends Basic
return $this->response("101", "验证码错误"); return $this->response("101", "验证码错误");
} }
$phone = $params["phone"]; $phone = $params["phone"];
$wx_union_id = !empty($params["wx_union_id"]) ? $params["wx_union_id"] : null; $wx_union_id = !empty($params["wx_union_id"]) ? trim($params["wx_union_id"]) : null;
$referrer_id = !empty($params["referrer_id"]) ? $params["referrer_id"] : 0; $referrer_id = !empty($params["referrer_id"]) ? $params["referrer_id"] : 0;
$referrer_source = !empty($params["referrer_source"]) ? $params["referrer_source"] : 0; $referrer_source = !empty($params["referrer_source"]) ? $params["referrer_source"] : 0;
$last_login_ip = ip2long($this->request->ip()); $last_login_ip = ip2long($this->request->ip());
...@@ -103,11 +103,11 @@ class Register extends Basic ...@@ -103,11 +103,11 @@ class Register extends Basic
*/ */
public function removeBinding() public function removeBinding()
{ {
$params = $this->params; $params = $this->params;
/* $params = array( /* $params = array(
"buyer_id" => 5, "buyer_id" => 5,
"user_id" => 25983, "user_id" => 25983,
);*/ );*/
$checkResult = $this->validate($params, "RegisterValidate.removeBind"); $checkResult = $this->validate($params, "RegisterValidate.removeBind");
if (true !== $checkResult) { if (true !== $checkResult) {
return $this->response("101", $checkResult); return $this->response("101", $checkResult);
...@@ -120,4 +120,28 @@ class Register extends Basic ...@@ -120,4 +120,28 @@ class Register extends Basic
return $this->response("101", "解绑失败"); return $this->response("101", "解绑失败");
} }
} }
/**
* 绑定微信
* @return \think\Response
*/
public function bindingWx()
{
$params = $this->params;
/* $params = array(
"wx_union_id" => "asdfasfasdf",
"phone" => 25983,
);*/
$checkResult = $this->validate($params, "RegisterValidate.bind");
if (true !== $checkResult) {
return $this->response("101", $checkResult);
}
$msg = $this->service_->binding($params["wx_union_id"], $params["phone"]);
if ($msg["code"] == 101) {
return $this->response("101", $msg["data"]);
} else {
return $this->response("200", "绑定成功", $msg["data"]);
}
}
} }
\ No newline at end of file
...@@ -132,6 +132,18 @@ class RegisterService ...@@ -132,6 +132,18 @@ class RegisterService
return $this->userModel->unbundlingWx($params); return $this->userModel->unbundlingWx($params);
} }
/**
* 绑定微信
* @param $wx_union_id
* @param $phone
* @return array
*/
public function binding($wx_union_id, $phone)
{
return $this->userRegister($phone, 0, 0, $wx_union_id, 0);
}
/** /**
* 组装bin * 组装bin
* @param $user_nick * @param $user_nick
...@@ -182,7 +194,7 @@ class RegisterService ...@@ -182,7 +194,7 @@ class RegisterService
$userParams["update_time"] = date("Y-m-d H:i:s", time()); $userParams["update_time"] = date("Y-m-d H:i:s", time());
//分享出去激活的不记录登录时间和ip //分享出去激活的不记录登录时间和ip
if ($referrer_id == 0) { if ($referrer_id == 0 && $last_login_ip != 0) {
$userParams["last_login_ip"] = $last_login_ip; $userParams["last_login_ip"] = $last_login_ip;
$userParams["last_login_time"] = date("Y-m-d H:i:s", time()); $userParams["last_login_time"] = date("Y-m-d H:i:s", time());
} }
......
...@@ -39,5 +39,6 @@ class RegisterValidate extends Validate ...@@ -39,5 +39,6 @@ class RegisterValidate extends Validate
'verify' => [ 'phone', 'device_id' ], 'verify' => [ 'phone', 'device_id' ],
'register' => [ 'phone', 'device_id', 'code' ], 'register' => [ 'phone', 'device_id', 'code' ],
'removeBind' => [ 'user_id', 'buyer_id' ], 'removeBind' => [ 'user_id', 'buyer_id' ],
'bind' => [ 'user_id', 'wx_union_id' ],
]; ];
} }
\ No newline at end of file
...@@ -31,8 +31,14 @@ class Index ...@@ -31,8 +31,14 @@ class Index
public function index() public function index()
{ {
$code = empty($_GET['code']) ? null : $_GET['code']; $code = empty($_GET['code']) ? null : $_GET['code'];
$referrer_id = empty($_GET['referrer_id']) ? null : $_GET['referrer_id']; $referrer_id = empty($_GET['referrer_id']) ? 0 : $_GET['referrer_id'];
$referrer_source = empty($_GET['referrer_source']) ? null : $_GET['referrer_source']; $referrer_source = empty($_GET['referrer_source']) ? 0 : $_GET['referrer_source'];
if($referrer_id == 0 || $referrer_source == 0){
return ["code"=>101,"msg"=>"邀请链接已失效"];
}
$this->url .= "?referrer_id=$referrer_id&referrer_source=$referrer_source";
Log::record("session referrer_id -----------------" . $referrer_id, "info");
Log::record("session referrer_source -----------------" . $referrer_source, "info");
if (!$code) { if (!$code) {
$this->_wxApi->getWxCode($this->url); $this->_wxApi->getWxCode($this->url);
......
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
</select> </select>
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="user_phone" placeholder="手机号" type="text" value=""> <input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="user_phone" placeholder="手机号" type="text" value="">
<input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="user_name" placeholder="姓名" type="text" value=""> <input class="form-control btn2 ld-Marheight" data-rule-phoneus="false" data-rule-required="false" id="user_name" placeholder="姓名" type="text" value="">
<span class="fore-span ld-Marheight">进场平均分数:</span><span class="fore-span ld-Marheight evaluation-score" id='average_score'></span> <!-- <span class="fore-span ld-Marheight">进场平均分数:</span><span class="fore-span ld-Marheight evaluation-score" id='average_score'>空</span>-->
<span class="fore-span ld-Marheight">评价平均分数:</span><span class="fore-span ld-Marheight evaluation-score" id='average_score_evaluation'></span> <span class="fore-span ld-Marheight">评价平均分数:</span><span class="fore-span ld-Marheight evaluation-score" id='average_score_evaluation'></span>
<span class="btn btn-info btn3 ld-Marheight" id="search">搜索</span> <span class="btn btn-info btn3 ld-Marheight" id="search">搜索</span>
<span class="btn btn-info btn3 ld-Marheight" id="reset">重置</span> <span class="btn btn-info btn3 ld-Marheight" id="reset">重置</span>
......
...@@ -515,7 +515,7 @@ class OReportModel extends Model ...@@ -515,7 +515,7 @@ class OReportModel extends Model
*/ */
public function getWaitToSeeList($pageNo = 1, $pageSize = 15, $order_ = 'id desc', $field, $params) public function getWaitToSeeList($pageNo = 1, $pageSize = 15, $order_ = 'id desc', $field, $params)
{ {
$data = $this /*$data = $this
->field($field) ->field($field)
->alias("a") ->alias("a")
->join("o_order b", "b.f_id = a.id", "left") ->join("o_order b", "b.f_id = a.id", "left")
...@@ -525,8 +525,49 @@ class OReportModel extends Model ...@@ -525,8 +525,49 @@ class OReportModel extends Model
->order($order_) ->order($order_)
->limit($pageSize) ->limit($pageSize)
->page($pageNo) ->page($pageNo)
->select(); ->select();*/
//echo $this->getLastSql();
$start_index = ($pageNo - 1) * $pageSize;
if (isset($params["user_id"])) {
$user_id = $params["user_id"];
}
$sql = "select * from ((
SELECT
`a`.`id`,
a.user_id,
a.report_agent_id AS agents_id,
a.predict_see_time AS expect_time,
`b`.`house_id`,
d.external_title AS house_title,
d.residue_num AS room_num_left
FROM
`o_report` `a`
LEFT JOIN `o_order` `b` ON `b`.`f_id` = `a`.`id`
LEFT JOIN `o_march_in` `c` ON `c`.`report_id` = `b`.`id`
LEFT JOIN `g_houses` `d` ON `d`.`id` = `b`.`house_id`
WHERE
`a`.`user_id` = $user_id
AND (`c`.`id` IS NULL)
)
UNION
(
SELECT
a.id,
a.agents_id,
a.expect_time,
a.house_id,
a.user_id,
b.external_title AS house_title,
b.residue_num AS room_num_left
FROM
u_appoint_watch_shop a
LEFT JOIN g_houses b ON a.house_id = b.id
WHERE
a.user_id = $user_id
and a.status in (0,1)
) ) as aaa limit $start_index,$pageSize";
$data = $this->db->query($sql);
return $data; return $data;
} }
......
...@@ -317,6 +317,7 @@ Route::group('api', [ ...@@ -317,6 +317,7 @@ Route::group('api', [
'sendCode' => [ 'api/Register/registerSendCode', [ 'method' => 'POST' ] ], 'sendCode' => [ 'api/Register/registerSendCode', [ 'method' => 'POST' ] ],
'userVerify' => [ 'api/Register/registerVerify', [ 'method' => 'POST' ] ], 'userVerify' => [ 'api/Register/registerVerify', [ 'method' => 'POST' ] ],
'removeBind' => [ 'api/Register/removeBinding', [ 'method' => 'POST|GET' ] ], 'removeBind' => [ 'api/Register/removeBinding', [ 'method' => 'POST|GET' ] ],
'bindingWx' => [ 'api/Register/bindingWx', [ 'method' => 'POST' ] ], //绑定微信
]); ]);
......
...@@ -6,7 +6,13 @@ ...@@ -6,7 +6,13 @@
<td>[%= it[item]['appellation'] %]</td> <td>[%= it[item]['appellation'] %]</td>
<td>[%= it[item]["phone"] %]</td> <td>[%= it[item]["phone"] %]</td>
<td>[%= it[item]["expect_time"] %]</td> <td>[%= it[item]["expect_time"] %]</td>
<td>[%= it[item]["other_require"] %]</td> <td>[% if(it[item]["other_require"] != null) { %]
[%= it[item]['other_require'] %]
[% } %]</td>
<!--<td>[%= it[item]["other_require"] %]</td>-->
<!--[% if(it[item]["dish_name"] != "") { %]
[%= it[item]['dish_name'] %]
[% } %]-->
<td>[%= it[item]["create_time"] %]</td> <td>[%= it[item]["create_time"] %]</td>
<td> <td>
<a class="btn1 btn-success " href="#modal-process" data-toggle="modal" data-id="[%= it[item]['id'] %]" onclick="alertFollow(this)">跟进</a> <a class="btn1 btn-success " href="#modal-process" data-toggle="modal" data-id="[%= it[item]['id'] %]" onclick="alertFollow(this)">跟进</a>
......
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