hrjy 2 anos atrás
pai
commit
77fbd8157b

+ 17 - 0
app/api/controller/PublicController.php

@@ -330,4 +330,21 @@ class PublicController
         return app('json')->successful($list);
     }
 
+    /**
+     * 门店详情
+     * @param $id
+     * @return mixed
+     * @throws \think\db\exception\DataNotFoundException
+     * @throws \think\db\exception\DbException
+     * @throws \think\db\exception\ModelNotFoundException
+     */
+    public function store_details($id)
+    {
+        $data = SystemStore::find($id);
+        $data = empty($data) ? [] : $data->toArray();
+        $data['slider_image'] = json_decode($data['slider_image']);
+        $data['images'] = json_decode($data['gatehead']);
+        return app('json')->successful($data);
+    }
+
 }

+ 1 - 0
app/api/controller/user/UserController.php

@@ -70,6 +70,7 @@ class UserController
         }else{
             $info['level_name'] = '粉丝';
         }
+        UserLevel::setLevelComplete($request->uid());
         return app('json')->success($info);
     }
 

+ 2 - 4
app/models/system/SystemUserTask.php

@@ -276,9 +276,8 @@ class SystemUserTask extends BaseModel
     public static function silver($task_id, $uid = 0, $start_time = 0, $number = 0)
     {
         $isComplete = false;
-        $product = StoreProduct::where([['cate_id', '=', 53], ['price', '=', 200]])->value('id'); // 两百的礼包
         $order = StoreOrder::where([['uid', '=', $uid], ['paid', '=', 1]])->column('id');
-        $orderInfo = StoreOrderCartInfo::where([['oid', 'in', $order], ['product_id', '=', $product]])->find();
+        $orderInfo = StoreOrderCartInfo::where([['oid', 'in', $order], ['product_id', '=', 1]])->find();
         if ($orderInfo) $isComplete = UserTaskFinish::setFinish($uid, $task_id) ? true : false;
         return ['还需购买200礼包', $orderInfo,$isComplete];
     }
@@ -294,9 +293,8 @@ class SystemUserTask extends BaseModel
     public static function gold($task_id, $uid = 0, $start_time = 0, $number = 0)
     {
         $isComplete = false;
-        $product = StoreProduct::where([['cate_id', '=', 53], ['price', '=', 1991]])->value('id'); // 两百的礼包
         $order = StoreOrder::where([['uid', '=', $uid], ['paid', '=', 1]])->column('id');
-        $orderInfo = StoreOrderCartInfo::where([['oid', 'in', $order], ['product_id', '=', $product]])->find();
+        $orderInfo = StoreOrderCartInfo::where([['oid', 'in', $order], ['product_id', '=', 2]])->find();
         if ($orderInfo) $isComplete = UserTaskFinish::setFinish($uid, $task_id) ? true : false;
         return ['还需购买1991礼包', $orderInfo,$isComplete];
     }

+ 2 - 2
app/models/user/User.php

@@ -1043,10 +1043,10 @@ class User extends BaseModel
 
     /**
      * 获取ID
-     * @param $key
+     * @param string $key 键名
      * @return mixed
      */
-    public static function getkeytoid($key)
+    public static function getkeytoid(string $key)
     {
         $rs = self::order('uid DESC')->find();
         return $rs['uid']+1;

+ 1 - 0
route/api/route.php

@@ -227,6 +227,7 @@ Route::group(function () {
 
     //门店列表
     Route::get('store_list', 'PublicController/store_list')->name('storeList');
+    Route::get('store_details/:id', 'PublicController/store_details')->name('store_details');
     //获取城市列表
     Route::get('city_list', 'PublicController/city_list')->name('cityList');