Commit 1140f218 authored by hujun's avatar hujun

拨打界面新增号码限制

parent 4f4cbc0a
......@@ -31,6 +31,7 @@ class CellPhone extends Basic
* @throws \think\exception\DbException
*/
public function bindAXB() {
header('Access-Control-Allow-Origin:*');
$params = $this->request->param();
if ($params['phone_a'] || $params['phone_b']) {
$phone_a = $this->params['phone_a'];//经纪人手机号
......@@ -88,6 +89,7 @@ class CellPhone extends Basic
* @return \think\Response
*/
public function updateBindAXB() {
header('Access-Control-Allow-Origin:*');
$params = $this->request->param();
if ($params['phone_x'] && ($params['phone_a'] || $params['phone_b'])) {
$bind = new BindingPhone();
......@@ -121,6 +123,7 @@ class CellPhone extends Basic
* @throws \think\exception\DbException
*/
public function agentsUnBind() {
header('Access-Control-Allow-Origin:*');
$phone_x = $this->params['phone_x'];
$phone_a = $this->params['phone_a'];
$phone_b = $this->params['phone_b'];
......
......@@ -12,6 +12,7 @@ namespace app\api_broker\extend;
use app\model\AAgents;
use app\model\Users;
use app\model\GOperatingRecords;
use Firebase\JWT\JWT;
use think\Controller;
use think\Db;
use think\Request;
......
......@@ -20,6 +20,12 @@ class AAgentsPhone extends BaseModel
* @throws \Exception
*/
public function add($id, $phone) {
$num = $this->where(['agents_id'=>$id,'status'=>0])->count();
$phone_num = count($phone);
if (($num > 2) || ($phone_num > 2)) {
$result = 0;
} else {
if (is_array($phone)) {
$insert_data = [];
$phone = array_unique($phone);
......@@ -39,8 +45,9 @@ class AAgentsPhone extends BaseModel
} else {
$result = 0;
}
}
}
return $result;
}
......
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