Commit 433b1270 authored by hujun's avatar hujun

Merge branch 'test' into test-0814-bug

# Conflicts: # application/index/controller/Remark.php
parents 1635938e c2dff300
This diff is collapsed.
...@@ -9,8 +9,11 @@ namespace app\api\extend; ...@@ -9,8 +9,11 @@ namespace app\api\extend;
* Time: 9:35 * Time: 9:35
* 基类 * 基类
*/ */
use app\extra\RedisExt;
use app\model\Users; use app\model\Users;
use think\Controller; use think\Controller;
use think\Exception;
use Think\Log;
use think\Request; use think\Request;
use think\Response; use think\Response;
use Qiniu; use Qiniu;
...@@ -27,6 +30,8 @@ class Basic extends Controller ...@@ -27,6 +30,8 @@ class Basic extends Controller
public $params; public $params;
public $user_city;
protected $authToken; protected $authToken;
/** /**
...@@ -37,7 +42,7 @@ class Basic extends Controller ...@@ -37,7 +42,7 @@ class Basic extends Controller
protected $phone; protected $phone;
protected $timeStamp_; protected $timeStamp_;
protected $filterVerify = array( protected $filterVerify = array(
"api/shopDetail", "api/getShopList",
"api/sendSms", "api/sendSms",
"api/sendCode", "api/sendCode",
"api/userVerify", "api/userVerify",
...@@ -98,6 +103,8 @@ class Basic extends Controller ...@@ -98,6 +103,8 @@ class Basic extends Controller
$this->timeStamp_ = $result->timeStamp_; $this->timeStamp_ = $result->timeStamp_;
} }
//$this->getCity($this->userId);
$requestPath = $this->request->routeInfo()["rule"][0] . "/" . $this->request->routeInfo()["rule"][1]; $requestPath = $this->request->routeInfo()["rule"][0] . "/" . $this->request->routeInfo()["rule"][1];
//过滤掉不需要验证token的接口 //过滤掉不需要验证token的接口
if (!in_array(trim($requestPath), $this->filterVerify)) { if (!in_array(trim($requestPath), $this->filterVerify)) {
...@@ -105,6 +112,27 @@ class Basic extends Controller ...@@ -105,6 +112,27 @@ class Basic extends Controller
} }
} }
/**
* 默认城市选择
* @param $userId
*/
public function getCity($userId)
{
try {
$redis_ = RedisExt::getRedis();
if ($redis_) {
$city = $redis_->get("user_city_" . $userId);
$this->user_city = empty($city) ? "上海市" : $city;
} else {
$this->user_city = "上海市";
}
Log::record("-------basic-------".$redis_->get("user_city_" . $userId),"info");
} catch (Exception $exception) {
$this->user_city = "上海市";
}
}
/** /**
* token 验证 * token 验证
*/ */
......
...@@ -182,9 +182,9 @@ class User extends Basic ...@@ -182,9 +182,9 @@ class User extends Basic
$params = $this->params; $params = $this->params;
/*$params = array( /*$params = array(
"user_id" => 3, "user_id" => 59089,
"agent_id" => 9, "agent_id" => 9,
"type" =>"last", "type" =>"next",
);*/ );*/
$checkResult = $this->validate($params, "UserGetLastOrNextUserIdValidate.verifyStatus"); $checkResult = $this->validate($params, "UserGetLastOrNextUserIdValidate.verifyStatus");
...@@ -193,7 +193,7 @@ class User extends Basic ...@@ -193,7 +193,7 @@ class User extends Basic
} }
// 判断是 杭州还是上海 // 判断是 杭州还是上海
$where['city'] = trim($this->city); $where['city'] = trim($this->city)? trim($this->city) :'上海市';
if ($params['type'] == 'last') { if ($params['type'] == 'last') {
$where['id'] = [ 'gt', $params['user_id'] ]; $where['id'] = [ 'gt', $params['user_id'] ];
$order = 'id asc'; $order = 'id asc';
...@@ -202,7 +202,6 @@ class User extends Basic ...@@ -202,7 +202,6 @@ class User extends Basic
$where['id'] = [ 'lt', $params['user_id'] ]; $where['id'] = [ 'lt', $params['user_id'] ];
$order = 'id desc'; $order = 'id desc';
} }
//dump($where);
$field = 'id,user_nick,agent_id,vip'; $field = 'id,user_nick,agent_id,vip';
$user = new Users(); $user = new Users();
$user_res = $user->getLastOrNextUserID($where, $field, $limit = 1, $order); $user_res = $user->getLastOrNextUserID($where, $field, $limit = 1, $order);
...@@ -212,7 +211,8 @@ class User extends Basic ...@@ -212,7 +211,8 @@ class User extends Basic
// 判断是否vip客户,如果是 只有是当前经纪人自己的客户才能查看 // 判断是否vip客户,如果是 只有是当前经纪人自己的客户才能查看
//vip客户 0:否 1:是 //vip客户 0:否 1:是
if (($user_res['vip'] == 1) && ($user_res['agent_id'] != $params['agent_id'])) {
if (($user_res[0]['vip'] == 1) && ($user_res[0]['agent_id'] != $params['agent_id'])) {
return $this->response("201", "vip 非客方", ['user_id'=>$user_res[0]['id']]); return $this->response("201", "vip 非客方", ['user_id'=>$user_res[0]['id']]);
} }
......
...@@ -348,11 +348,11 @@ ...@@ -348,11 +348,11 @@
<span class="fore-span ld-Marheight">-</span> <span class="fore-span ld-Marheight">-</span>
<input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="registration_end" name="registration_end" type="date"> <input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="registration_end" name="registration_end" type="date">
<span class="fore-span ld-Marheight">最后跟进时间:</span> <!--<span class="fore-span ld-Marheight">最后跟进时间:</span>-->
<input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="follow_start" name="follow_start" type="date"> <!--<input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="follow_start" name="follow_start" type="date">-->
<span class="fore-span ld-Marheight">-</span> <!--<span class="fore-span ld-Marheight">-</span>-->
<input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="follow_end" name="follow_end" type="date"> <!--<input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="follow_end" name="follow_end" type="date">-->
<div class="row"></div> <!--<div class="row"></div>-->
<!-- <span class="fore-span ld-Marheight">第一次登录时间:</span> <!-- <span class="fore-span ld-Marheight">第一次登录时间:</span>
<input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="login_start" name="login_start" type="date"> <input class="form-control btn4 ld-Marheight" value="" data-rule-phoneus="false" data-rule-required="false" id="login_start" name="login_start" type="date">
<span class="fore-span ld-Marheight">-</span> <span class="fore-span ld-Marheight">-</span>
......
...@@ -318,9 +318,9 @@ Route::group('api', [ ...@@ -318,9 +318,9 @@ Route::group('api', [
'uploadHeadImg' => [ 'api/member/uploadHeadImg', [ 'method' => 'post' ] ], //头像上传 'uploadHeadImg' => [ 'api/member/uploadHeadImg', [ 'method' => 'post' ] ], //头像上传
// shop // shop
'shopList' => [ 'api/shop/getShopList', [ 'method' => 'post' ] ], 'getShopList' => [ 'api/shop/getShopList', [ 'method' => 'get|post' ] ],
'filtrateCondition' => [ 'api/shop/filtrateCondition', [ 'method' => 'get | post' ] ], 'filtrateCondition' => [ 'api/shop/filtrateCondition', [ 'method' => 'get | post' ] ],
'shopDetail' => [ 'api/shop/getShopDetail', [ 'method' => 'get' ] ], 'getShopDetail' => [ 'api/shop/getShopDetail', [ 'method' => 'get|post' ] ],
'getMarchInList' => [ 'api/shop/getMarchInList', [ 'method' => 'get|post' ] ], 'getMarchInList' => [ 'api/shop/getMarchInList', [ 'method' => 'get|post' ] ],
//get banner //get banner
......
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