Commit 1ccda4bb authored by hujun's avatar hujun

上海地区号码

parent a41df2e7
...@@ -31,7 +31,7 @@ class CellPhone extends Basic ...@@ -31,7 +31,7 @@ class CellPhone extends Basic
header('Access-Control-Allow-Origin:*'); header('Access-Control-Allow-Origin:*');
$call = new CallPhoneService(); $call = new CallPhoneService($this->city);
$record = true; //是否录音 $record = true; //是否录音
$user_id = empty($this->params['user_id']) ? 0:(int)$this->params['user_id']; $user_id = empty($this->params['user_id']) ? 0:(int)$this->params['user_id'];
$house_id = empty($this->params['house_id']) ? 0:(int)$this->params['house_id']; $house_id = empty($this->params['house_id']) ? 0:(int)$this->params['house_id'];
......
...@@ -76,11 +76,11 @@ class PlsDemo ...@@ -76,11 +76,11 @@ class PlsDemo
* @param $phoneB * @param $phoneB
* @param $time 过期时间 * @param $time 过期时间
* @param bool $isRecordingEnabled 是否录音 * @param bool $isRecordingEnabled 是否录音
* @param string $poolKey 号码池Key
* @param string $phoneNoX 中间号码 * @param string $phoneNoX 中间号码
* @param $expectCity 城市
* @return mixed|\SimpleXMLElement * @return mixed|\SimpleXMLElement
*/ */
public static function bindAxb($phoneA, $phoneB, $time, $isRecordingEnabled=false, $phoneNoX = '') { public static function bindAxb($phoneA, $phoneB, $time, $isRecordingEnabled=false, $phoneNoX = '', $expectCity) {
//组装请求对象-具体描述见控制台-文档部分内容 //组装请求对象-具体描述见控制台-文档部分内容
$request = new BindAxbRequest(); $request = new BindAxbRequest();
...@@ -98,7 +98,7 @@ class PlsDemo ...@@ -98,7 +98,7 @@ class PlsDemo
$request->setPhoneNoX($phoneNoX); $request->setPhoneNoX($phoneNoX);
//可选:期望分配X号码归属的地市(省去地市后缀后的城市名称) //可选:期望分配X号码归属的地市(省去地市后缀后的城市名称)
$request->setExpectCity(""); $request->setExpectCity($expectCity);
//必填:绑定关系对应的失效时间-不能早于当前系统时间 //必填:绑定关系对应的失效时间-不能早于当前系统时间
$request->setExpiration($time); $request->setExpiration($time);
......
...@@ -157,7 +157,7 @@ class CellPhone extends Basic ...@@ -157,7 +157,7 @@ class CellPhone extends Basic
$house_id = empty($this->params['house_id']) ? 0:(int)$this->params['house_id']; $house_id = empty($this->params['house_id']) ? 0:(int)$this->params['house_id'];
$record = true; //录音 $record = true; //录音
$call_phone = new CallPhoneService(); $call_phone = new CallPhoneService($this->city);
$data = $call_phone->bindAXB($this->params['phone_a'], $phone_b, $record, $user_id, $this->userId, $this->userName, $house_id); $data = $call_phone->bindAXB($this->params['phone_a'], $phone_b, $record, $user_id, $this->userId, $this->userName, $house_id);
$result['msg'] = ''; $result['msg'] = '';
if ($data['status'] == 'success') { if ($data['status'] == 'success') {
......
...@@ -9,6 +9,7 @@ namespace app\index\extend; ...@@ -9,6 +9,7 @@ namespace app\index\extend;
* Time: 9:35 * Time: 9:35
* 基类 * 基类
*/ */
use app\extra\RedisExt;
use app\model\AAgents; use app\model\AAgents;
use app\model\GHousesToAgents; use app\model\GHousesToAgents;
use app\model\GOperatingRecords; use app\model\GOperatingRecords;
...@@ -36,6 +37,8 @@ class Basic extends Controller ...@@ -36,6 +37,8 @@ class Basic extends Controller
public $lastLoginTime; public $lastLoginTime;
public $city;
protected $filterVerify = array( protected $filterVerify = array(
'index/login', 'index/login',
'index/loginVerify', 'index/loginVerify',
...@@ -86,6 +89,9 @@ class Basic extends Controller ...@@ -86,6 +89,9 @@ class Basic extends Controller
$this->userVerify(); $this->userVerify();
$this->userAuth($requestPath); $this->userAuth($requestPath);
} }
//获取默认城市
$this->getCity($this->agentId);
} }
/** /**
...@@ -170,13 +176,7 @@ class Basic extends Controller ...@@ -170,13 +176,7 @@ class Basic extends Controller
if ($requestPath == 'index/editExclusive' && isset($this->params['exclusive_id'])) { if ($requestPath == 'index/editExclusive' && isset($this->params['exclusive_id'])) {
$m_house_agent = new GHousesToAgents(); $m_house_agent = new GHousesToAgents();
//独家方 //独家方
$exclusive_num = $m_house_agent->alias('a') $exclusive_num = $m_house_agent->getAgentHouseNum($this->params['exclusive_id'], 3);
->field('a.id')
->join('a_agents b', 'a.agents_id=b.id', 'left')
->where('a.is_del', 0)
->where('a.type', 3)
->where('a.agents_id', $this->params['exclusive_id'])
->count();
if ($exclusive_num > 0) { if ($exclusive_num > 0) {
$is_auth = 1; $is_auth = 1;
} }
...@@ -282,4 +282,25 @@ class Basic extends Controller ...@@ -282,4 +282,25 @@ class Basic extends Controller
$result = $records->record($agents_id, $type, $remark, '',$user_id); $result = $records->record($agents_id, $type, $remark, '',$user_id);
return $result; return $result;
} }
/**
* 默认城市选择
* @param $agentId
*/
public function getCity($agentId)
{
try {
$redis_ = RedisExt::getRedis();
if ($redis_) {
$city = $redis_->get("agent_city_" . $agentId);
$this->city = empty($city) ? "上海市" : $city;
} else {
$this->city = "上海市";
}
} catch (Exception $exception) {
$this->city = "上海市";
}
}
} }
\ 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