|
@@ -228,8 +228,12 @@ class member_buyControl extends mbMemberControl
|
|
|
[$fExtra, $extra_info, $order_check] = $this->extra_info($input['goods_id'], $_POST);
|
|
|
if (!$fExtra) {
|
|
|
Log::record("step_vsecond error", Log::ERR);
|
|
|
- return self::outerr(errcode::ErrInputParam, '缺少虚拟商品,额外指定参数.');
|
|
|
+ return self::outerr(errcode::ErrInputParam, '缺少虚拟商品额外指定参数.');
|
|
|
}
|
|
|
+ if(array_key_exists('phone_no',$extra_info['input']) && empty($extra_info['input']['phone_no'])) {
|
|
|
+ return self::outerr(errcode::ErrInputParam, '一个手机号只能绑定一张油卡,请换卡.');
|
|
|
+ }
|
|
|
+
|
|
|
if(!empty($order_check))
|
|
|
{
|
|
|
$logic = Logic('queue');
|
|
@@ -302,11 +306,56 @@ class member_buyControl extends mbMemberControl
|
|
|
$extra['additional'] = $handler['additional'];
|
|
|
}
|
|
|
|
|
|
+ if(array_key_exists('phone_no',$extra['input'])) {
|
|
|
+ $phone_no = $this->check_oilmobile($extra['input']);
|
|
|
+ $extra['input']['phone_no'] = $phone_no;
|
|
|
+ }
|
|
|
+
|
|
|
return [true, $extra, $handler['order_check']];
|
|
|
}
|
|
|
return [true, [], ''];
|
|
|
}
|
|
|
|
|
|
+ private function check_oilmobile($params)
|
|
|
+ {
|
|
|
+ $phone_no = $params['phone_no'];
|
|
|
+ $card_no = $params['card_no'];
|
|
|
+ if(empty($card_no)) {
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+
|
|
|
+ $find_card = function ($topcard,$card_no) {
|
|
|
+ $items = $topcard->table('topcard')->field('*')->where(['card_no' => $card_no])->select();
|
|
|
+ if(empty($items)) {
|
|
|
+ return "";
|
|
|
+ } else {
|
|
|
+ return $items[0]['bind_phone'];
|
|
|
+ }
|
|
|
+ };
|
|
|
+ $find_phone = function ($topcard,$phone_no) {
|
|
|
+ $items = $topcard->table('topcard')->field('*')->where(['bind_phone' => $phone_no])->select();
|
|
|
+ if(empty($items)) {
|
|
|
+ return "";
|
|
|
+ } else {
|
|
|
+ return $items[0]['card_no'];
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ $topcard = Model('topcard');
|
|
|
+ $phone = $find_card($topcard,$card_no);
|
|
|
+ if(!empty($phone)) {
|
|
|
+ return $phone;
|
|
|
+ }
|
|
|
+
|
|
|
+ $card = $find_phone($topcard,$phone_no);
|
|
|
+ if(empty($card)) {
|
|
|
+ return $phone_no;
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ return "";
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
public function pay_confirmOp()
|
|
|
{
|
|
|
$pay_sn = $_GET['pay_sn'];
|