allen 3 years ago
parent
commit
7fd2eebdf9
2 changed files with 14 additions and 4 deletions
  1. 13 3
      app/index/controller/Index.php
  2. 1 1
      app/service/WeiboService.php

+ 13 - 3
app/index/controller/Index.php

@@ -459,10 +459,10 @@ class Index extends Controller
             }
         }
 
+        $giftId = 0;
         // 如果中奖 插入用户中奖信息
         if ($isWinAward == 1) {
             $gifts = Db::table('awards_gift')->where('type', 2)->select();
-            $giftId = 0;
             foreach ($gifts as $val) {
                 if ($rank >= $val['min_rank'] && $rank <= $val['max_rank']) {
                     $giftId = $val['id'];
@@ -576,7 +576,7 @@ class Index extends Controller
     {
         $awards = Db::table('awards_order')->alias('o')
             ->leftJoin('awards_gift g', 'o.gift_id = g.id')
-            ->field(['g.name as giftName', 'o.type', 'o.create_at', 'o.gift_id'])
+            ->field(['g.name as giftName', 'o.*'])
             ->where('o.uid', Safe::$user['uid'])
             ->select();
 
@@ -586,12 +586,22 @@ class Index extends Controller
             if ($val['type'] == 2) {
                 $type = '排名奖';
             }
+
+            $isReceive = 1;
+            if (empty($val['name']) && empty($val['address']) && empty($val['mobile'])) {
+                $isReceive = 0;
+            }
+
             $res[] = [
                 'giftId' => $val['gift_id'],
                 'giftName' => $val['giftName'],
                 'typeLabel' => $type,
                 'type' => $val['type'],
-                'createAt' => date('y-m-d h:i:s', $val['create_at'])
+                'createAt' => date('y-m-d h:i:s', $val['create_at']),
+                'address' => $val['address'],
+                'name' => $val['name'],
+                'mobile' => $val['mobile'],
+                'isReceive' => $isReceive
             ];
         }
 

+ 1 - 1
app/service/WeiboService.php

@@ -229,7 +229,7 @@ class WeiboService
      */
     public function userinfo($sub)
     {
-        if (env('weibo.mock') == 1) {
+        if (env('weibo.mock') == 1 && $sub == "") {
             return [
                 'ok' => 1,
                 'msg' => '操作成功',