|
@@ -12,7 +12,7 @@ class merchant_infoControl extends mbMerchantControl
|
|
{
|
|
{
|
|
$mchid = $this->mchid();
|
|
$mchid = $this->mchid();
|
|
$model_merchant = Model('merchant');
|
|
$model_merchant = Model('merchant');
|
|
- $merchant_info = $model_merchant->getMerchantInfo(['mchid' => $mchid], 'mchid,admin_id,name,alarm_amount,ip_white_list,use_key,contact_name,contact_phone');
|
|
|
|
|
|
+ $merchant_info = $model_merchant->getMerchantInfo(['mchid' => $mchid], 'mchid,admin_id,name,alarm_amount,ip_white_list,use_key,contact_name,contact_phone,warning_phone');
|
|
$model_member = Model('member');
|
|
$model_member = Model('member');
|
|
$member_info = $model_member->getMemberInfo(['member_id' => $merchant_info['admin_id']], 'available_predeposit');
|
|
$member_info = $model_member->getMemberInfo(['member_id' => $merchant_info['admin_id']], 'available_predeposit');
|
|
if (empty($member_info)) {
|
|
if (empty($member_info)) {
|
|
@@ -25,6 +25,11 @@ class merchant_infoControl extends mbMerchantControl
|
|
} else {
|
|
} else {
|
|
$merchant_info['ips'] = unserialize($merchant_info['ip_white_list']);
|
|
$merchant_info['ips'] = unserialize($merchant_info['ip_white_list']);
|
|
}
|
|
}
|
|
|
|
+ if (empty($merchant_info['warning_phone'])) {
|
|
|
|
+ $merchant_info['warning_phone'] = [];
|
|
|
|
+ } else {
|
|
|
|
+ $merchant_info['warning_phone'] = unserialize($merchant_info['warning_phone']);
|
|
|
|
+ }
|
|
$cond['add_time'] = ['between', [strtotime(date("Y-m-d",time())), time()]];
|
|
$cond['add_time'] = ['between', [strtotime(date("Y-m-d",time())), time()]];
|
|
$cond['status'] = $cond['is_operation'] = 2;
|
|
$cond['status'] = $cond['is_operation'] = 2;
|
|
$cond['mchid'] = $mchid;
|
|
$cond['mchid'] = $mchid;
|
|
@@ -222,6 +227,55 @@ class merchant_infoControl extends mbMerchantControl
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public function addwphoneOp()
|
|
|
|
+ {
|
|
|
|
+ $mchid = $this->mchid();
|
|
|
|
+ $phone = $_POST['phone'];
|
|
|
|
+ if (empty($phone)) {
|
|
|
|
+ return self::outerr(errcode::ErrParamter, "参数错误");
|
|
|
|
+ }
|
|
|
|
+ $phone = explode(',' ,trim($phone));
|
|
|
|
+ $model_merchant = Model('merchant');
|
|
|
|
+ $merchant_info = $model_merchant->getMerchantInfo(['mchid' => $mchid]);
|
|
|
|
+ if (empty($merchant_info['warning_phone'])) {
|
|
|
|
+ $phones = [];
|
|
|
|
+ } else {
|
|
|
|
+ $phones = unserialize($merchant_info['warning_phone']);
|
|
|
|
+ }
|
|
|
|
+ foreach ($phone as $item) {
|
|
|
|
+ $phones[] = $item;
|
|
|
|
+ }
|
|
|
|
+ $phones = array_unique($phones);
|
|
|
|
+ $model_merchant->editMerchant(['warning_phone' => serialize($phones)], ['mchid' => $merchant_info['mchid']]);
|
|
|
|
+ return self::outsuccess([]);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public function wphonedelOp()
|
|
|
|
+ {
|
|
|
|
+ $mchid = $this->mchid();
|
|
|
|
+ $phone = $_POST['phone'];
|
|
|
|
+ if (empty($phone)) {
|
|
|
|
+ return self::outerr(errcode::ErrParamter, "参数错误");
|
|
|
|
+ }
|
|
|
|
+ $phone = trim($phone);
|
|
|
|
+ $model_merchant = Model('merchant');
|
|
|
|
+ $merchant_info = $model_merchant->getMerchantInfo(['mchid' => $mchid]);
|
|
|
|
+ $phones = unserialize($merchant_info['warning_phone']);
|
|
|
|
+ $new_phones = [];
|
|
|
|
+ foreach ($phones as $value) {
|
|
|
|
+ if ($value != $phone) {
|
|
|
|
+ $new_phones[] = $value;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if (empty($new_phones)) {
|
|
|
|
+ $new_phones = '';
|
|
|
|
+ } else {
|
|
|
|
+ $new_phones = serialize($new_phones);
|
|
|
|
+ }
|
|
|
|
+ $model_merchant->editMerchant(['warning_phone' => $new_phones], ['mchid' => $merchant_info['mchid']]);
|
|
|
|
+ return self::outsuccess([]);
|
|
|
|
+ }
|
|
|
|
+
|
|
public function setkeyOp()
|
|
public function setkeyOp()
|
|
{
|
|
{
|
|
$mchid = $this->mchid();
|
|
$mchid = $this->mchid();
|