lizhen 1 week geleden
bovenliggende
commit
9f42bf2e59

+ 3 - 3
addons/unishop/controller/Order.php

@@ -444,16 +444,16 @@ class Order extends Base
             }
 
             //归还优惠券
-            $coupon_user_id = Db::name('unishop_order_extend')->where('order_id',$order_id)->value('coupon_user_id');
+           /* $coupon_user_id = Db::name('unishop_order_extend')->where('order_id',$order_id)->value('coupon_user_id');
             if(!empty($coupon_user_id)){
                 Db::name('unishop_coupon_user')->where('id',$coupon_user_id)->where('user_id',$this->auth->id)->update(['status'=>0]);
-            }
+            }*/
 
             //同意并执行退款
             if($refund_status == 3 && $refund_amount > 0){
                 $order = Db::name('unishop_order')->where('id',$order_id)->find();
 
-                if($order['pay_type'] == 3){
+                if($order['pay_type'] == 3){ //微信支付
                     $refund_result = $this->old_refund($order,$refund_amount);
                     if($refund_result !== true){
                         Db::rollback();

+ 12 - 8
application/api/controller/Hexiao.php

@@ -18,7 +18,7 @@ class Hexiao extends Api
     //order_no:2024090466d7c9d5abb1c1
     public function order_info()
     {
-        if($this->auth->group_id != 3){$this->error('你是不是来错地方了?');}
+        if($this->auth->group_id != 3){$this->error('没有权限');}
 
         $code = input('code','');
         if(strpos($code,'order_hexiao_no|') !== 0){
@@ -91,10 +91,14 @@ class Hexiao extends Api
                     $product['evaluate'] = false;
                 }*/
 
+                $product_find = Db::name('unishop_product')->where('id', $product['product_id'])->find();
+                $product['info'] = $product_find['info'];
+                $product['activetime'] = $product_find['activetime'];
+
                 //限定核销产品
-                if(!in_array($product['product_id'],explode(',',$this->auth->product_ids))){
+                /*if(!in_array($product['product_id'],explode(',',$this->auth->product_ids))){
                     $this->error('您无法核销当前订单,请移至正确核销点,或联系客服','',2);
-                }
+                }*/
 
             }
 
@@ -130,7 +134,7 @@ class Hexiao extends Api
 
     //完成核销动作
     public function hexiao(){
-        if($this->auth->group_id != 3){$this->error('你是不是来错地方了?');}
+        if($this->auth->group_id != 3){$this->error('没有权限');}
 //        $order_id = input('order_id', 0);
 //        $order_id = \addons\unishop\extend\Hashids::decodeHex($order_id);
 
@@ -163,12 +167,12 @@ class Hexiao extends Api
         }
 
         //限定核销产品
-        $products = Db::name('unishop_order_product')->where('order_id',$order['id'])->select();
+        /*$products = Db::name('unishop_order_product')->where('order_id',$order['id'])->select();
         foreach($products as $key => $product){
             if(!in_array($product['product_id'],explode(',',$this->auth->product_ids))){
                 $this->success('您无法核销当前订单,请移至正确核销点,或联系客服','',2);
             }
-        }
+        }*/
 
         $update = [
             'have_received' => time(),
@@ -181,7 +185,7 @@ class Hexiao extends Api
         }
 
         //给推广人结算
-        if($order['intro_uid']){
+        /*if($order['intro_uid']){
 
             $bili = config('site.unishop_order_intromoney_bili');
 
@@ -196,7 +200,7 @@ class Hexiao extends Api
                 }
             }
 
-        }
+        }*/
 
         Db::commit();
         $this->success('核销成功');

+ 4 - 1
application/api/controller/User.php

@@ -151,7 +151,10 @@ class User extends Api
             //如果已经有账号则直接登录
             $res = $this->auth->direct($userInfo['id']);
         } else {
-            $res = $this->auth->openid_register($openid);
+            $extend = [
+                'wxmini_openid' => $openid
+            ];
+            $res = $this->auth->register('','','','',$extend);
         }
         if($res) {
             $this->success("登录成功!",$this->auth->getUserinfo());

+ 7 - 2
application/common/library/Auth.php

@@ -135,7 +135,7 @@ class Auth
     {
         // 检测用户名、昵称、邮箱、手机号是否存在
 
-        if (User::getByMobile($mobile)) {
+        if ($mobile && User::getByMobile($mobile)) {
             $this->setError('Mobile already exist');
             return false;
         }
@@ -175,7 +175,12 @@ class Auth
             $this->_logined = true;
 
             //注册钱包
-            Db::name('user_wallet')->insertGetId(['user_id'=>$user->id]);
+            /*$wallet_id = Db::name('user_wallet')->insertGetId(['user_id'=>$user->id]);
+            if(!$wallet_id){
+                $this->setError('注册用户失败');
+                Db::rollback();
+                return false;
+            }*/
 
             //注册成功的事件
             Hook::listen("user_register_successed", $this->_user, $data);