|
@@ -17,7 +17,7 @@ use think\Db; |
|
@@ -17,7 +17,7 @@ use think\Db; |
17
|
*/
|
17
|
*/
|
18
|
class Classification extends Api
|
18
|
class Classification extends Api
|
19
|
{
|
19
|
{
|
20
|
- protected $noNeedLogin = ['*'];
|
20
|
+ protected $noNeedLogin = ['sort'];
|
21
|
protected $noNeedRight = ['*'];
|
21
|
protected $noNeedRight = ['*'];
|
22
|
|
22
|
|
23
|
/**
|
23
|
/**
|
|
@@ -99,6 +99,10 @@ class Classification extends Api |
|
@@ -99,6 +99,10 @@ class Classification extends Api |
99
|
$goods_spec = Db::name('litestore_goods_spec')
|
99
|
$goods_spec = Db::name('litestore_goods_spec')
|
100
|
->where('goods_id',$item['goods_id'])
|
100
|
->where('goods_id',$item['goods_id'])
|
101
|
->find();
|
101
|
->find();
|
|
|
102
|
+ $item['cart_number'] = Db::name('cart')
|
|
|
103
|
+ ->where('user_id',$this->auth->id)
|
|
|
104
|
+ ->where('goods_id',$item['goods_id'])
|
|
|
105
|
+ ->sum('number');
|
102
|
$item['price'] = $goods_spec['goods_price'];
|
106
|
$item['price'] = $goods_spec['goods_price'];
|
103
|
$item['line_price'] = $goods_spec['line_price'];
|
107
|
$item['line_price'] = $goods_spec['line_price'];
|
104
|
});
|
108
|
});
|
|
@@ -110,6 +114,10 @@ class Classification extends Api |
|
@@ -110,6 +114,10 @@ class Classification extends Api |
110
|
$goods_spec = Db::name('litestore_goods_spec')
|
114
|
$goods_spec = Db::name('litestore_goods_spec')
|
111
|
->where('goods_id',$item['goods_id'])
|
115
|
->where('goods_id',$item['goods_id'])
|
112
|
->find();
|
116
|
->find();
|
|
|
117
|
+ $item['cart_number'] = Db::name('cart')
|
|
|
118
|
+ ->where('user_id',$this->auth->id)
|
|
|
119
|
+ ->where('goods_id',$item['goods_id'])
|
|
|
120
|
+ ->sum('number');
|
113
|
$item['price'] = $goods_spec['goods_price'];
|
121
|
$item['price'] = $goods_spec['goods_price'];
|
114
|
$item['line_price'] = $goods_spec['line_price'];
|
122
|
$item['line_price'] = $goods_spec['line_price'];
|
115
|
});
|
123
|
});
|