作者 jinglong
1 个管道 的构建 通过 耗费 7 秒

修改七牛云配置

@@ -9,7 +9,7 @@ return array ( @@ -9,7 +9,7 @@ return array (
9 'content' => 9 'content' =>
10 array ( 10 array (
11 ), 11 ),
12 - 'value' => 'm92odJHsEMRW6ZZzpwwCHRejn2kgK8Y4jEiMSlXk', 12 + 'value' => 'SH67W5to4mQn8ggENnnBJ0KaR_v4RADhIr27BweJ',
13 'rule' => 'required', 13 'rule' => 'required',
14 'msg' => '', 14 'msg' => '',
15 'tip' => '请在个人中心 > 密钥管理中获取 > AK', 15 'tip' => '请在个人中心 > 密钥管理中获取 > AK',
@@ -24,7 +24,7 @@ return array ( @@ -24,7 +24,7 @@ return array (
24 'content' => 24 'content' =>
25 array ( 25 array (
26 ), 26 ),
27 - 'value' => 'YxYBAjxBLZTC1N9crjzwLkWTBxKi_MIv9pUHK0IS', 27 + 'value' => '25Umqk4bIBBBdbunXh4jW1Co5VJLH8qXe9X_ZpIE',
28 'rule' => 'required', 28 'rule' => 'required',
29 'msg' => '', 29 'msg' => '',
30 'tip' => '请在个人中心 > 密钥管理中获取 > SK', 30 'tip' => '请在个人中心 > 密钥管理中获取 > SK',
@@ -39,7 +39,7 @@ return array ( @@ -39,7 +39,7 @@ return array (
39 'content' => 39 'content' =>
40 array ( 40 array (
41 ), 41 ),
42 - 'value' => 'jinglong', 42 + 'value' => 'feifangu',
43 'rule' => 'required', 43 'rule' => 'required',
44 'msg' => '', 44 'msg' => '',
45 'tip' => '存储空间名称', 45 'tip' => '存储空间名称',
@@ -59,7 +59,7 @@ return array ( @@ -59,7 +59,7 @@ return array (
59 'https://upload-na0.qiniup.com' => '北美 https://upload-na0.qiniup.com', 59 'https://upload-na0.qiniup.com' => '北美 https://upload-na0.qiniup.com',
60 'https://upload-as0.qiniup.com' => '东南亚 https://upload-as0.qiniup.com', 60 'https://upload-as0.qiniup.com' => '东南亚 https://upload-as0.qiniup.com',
61 ), 61 ),
62 - 'value' => 'https://upload-z1.qiniup.com', 62 + 'value' => 'https://upload-z0.qiniup.com',
63 'rule' => 'required', 63 'rule' => 'required',
64 'msg' => '', 64 'msg' => '',
65 'tip' => '推荐选择最近的地址', 65 'tip' => '推荐选择最近的地址',
@@ -74,7 +74,7 @@ return array ( @@ -74,7 +74,7 @@ return array (
74 'content' => 74 'content' =>
75 array ( 75 array (
76 ), 76 ),
77 - 'value' => 'http://jinglong.springchunjia.cn', 77 + 'value' => 'http://feifangu.qiniu.brotop.cn',
78 'rule' => 'required', 78 'rule' => 'required',
79 'msg' => '', 79 'msg' => '',
80 'tip' => '未绑定CDN的话可使用七牛分配的测试域名', 80 'tip' => '未绑定CDN的话可使用七牛分配的测试域名',
@@ -8,6 +8,7 @@ use app\common\controller\Api; @@ -8,6 +8,7 @@ use app\common\controller\Api;
8 use fast\Http; 8 use fast\Http;
9 use think\Validate; 9 use think\Validate;
10 use think\Db; 10 use think\Db;
  11 +use think\db\Expression;
11 12
12 /** 13 /**
13 * 个人中心接口 14 * 个人中心接口
@@ -326,57 +327,15 @@ class User extends Api @@ -326,57 +327,15 @@ class User extends Api
326 $this->error($validate->getError()); 327 $this->error($validate->getError());
327 } 328 }
328 329
329 - $is_news = Common::is_new($this->uid);  
330 - $limit = config('verify.limit');  
331 - $where = ['uid'=>$this->uid];  
332 - if($is_news == 1){  
333 - //旧人  
334 - $where['is_new'] = 0;  
335 - }  
336 - $res = Db::name('collection')  
337 - ->alias('c')  
338 - ->join('goods g','c.g_id = g.id')  
339 - ->where($where)  
340 - ->field('g.id,g.image,g.name,g.tag,g.style,g.sale_price1 sale_price,g.expense_price,g.is_new')  
341 - ->page($page,$limit)  
342 - ->order('c.id desc')  
343 - ->useSoftDelete('g.deletetime')  
344 - ->select(); 330 + $collection = Common::selectWhereData('collection',['uid'=>$this->uid],'id,g_id');
  331 + $g_ids = array_column($collection,'g_id');
345 332
346 - foreach ($res as &$value){  
347 - if($is_news == 2 || $is_news == 0){//未登录或者新人  
348 - if($value['is_new'] == 0){  
349 - //非新人优惠标签  
350 - $value['is_new_tag'] = 0;//不用显示新人价标签  
351 - }else{  
352 - //新人优惠标签  
353 - $value['is_new_tag'] = 1;//显示新人价标签  
354 - }  
355 - }else{  
356 - $value['is_new_tag'] = 0;//不用显示新人价标签(新人价标签商品不会出来)  
357 - }  
358 - $value['image'] = Common::absolutionUrlOne($value['image']);  
359 - $value['style'] = explode('|',$value['style']);  
360 - $value['tag'] = explode('|',$value['tag']);  
361 - $sale_price = Common::salePrice($value['sale_price']);  
362 - if($sale_price){  
363 - $value['sale_price'] = $sale_price[0];  
364 - }else{  
365 - $value['sale_price'] = '';  
366 - }  
367 - unset($value['is_new']);  
368 - }  
369 - $arr['data'] = $res;  
370 - //总页数 333 + //按照指定的顺序排序
  334 + $g_id_str = implode(',',$g_ids);
  335 + $exp = new Expression('field(id,'.$g_id_str.')');
371 336
372 - $count= Db::name('collection')  
373 - ->alias('c')  
374 - ->join('goods g','c.g_id = g.id')  
375 - ->where($where)  
376 - ->order('c.id desc')  
377 - ->useSoftDelete('g.deletetime')  
378 - ->count();  
379 - $arr['total_page'] = ceil($count/$limit); 337 + $limit = config('verify.limit');
  338 + $arr = Common::goodsList(['id'=>['in',$g_ids]],$page,$this->uid,$limit,$exp);
380 $this->success('成功',$arr); 339 $this->success('成功',$arr);
381 }else{ 340 }else{
382 $this->error('请求方式错误'); 341 $this->error('请求方式错误');