|
|
@@ -289,24 +289,21 @@ class PublicController
|
|
|
*/
|
|
|
public function store_list(Request $request)
|
|
|
{
|
|
|
- list($latitude, $longitude, $page, $limit, $cate_id, $name) = UtilService::getMore([
|
|
|
+ list($latitude, $longitude, $page, $limit, $cate_id, $name, $sales) = UtilService::getMore([
|
|
|
['latitude', ''],
|
|
|
['longitude', ''],
|
|
|
['page', 1],
|
|
|
['limit', 10],
|
|
|
['cate_id'],
|
|
|
- ['name', '']
|
|
|
+ ['name', ''],
|
|
|
+ ['sales', '']
|
|
|
], $request, true);
|
|
|
- $list = SystemStore::lst($latitude, $longitude, $page, $limit, $cate_id,$name);
|
|
|
+ $list = SystemStore::lst($latitude, $longitude, $page, $limit, $cate_id,$name, $sales);
|
|
|
if (!$list){
|
|
|
$list = [];
|
|
|
} else{
|
|
|
foreach ($list as &$item) {
|
|
|
- $coupon = StoreCoupon::where('store_id', $item['id'])->column('id');
|
|
|
- $item['coupon'] = StoreProduct::field('id,store_name,price,ot_price')->where('coupon', 'in',$coupon)->where('id', '>', 2)->select();
|
|
|
- $id = StoreProduct::where('coupon', $item['id'])->where('id', '>', 2)->column('id');
|
|
|
- $orderId = StoreOrderCartInfo::where('product_id', 'in',$id)->column('oid');
|
|
|
- $item['count'] = count($orderId) > 0?StoreOrder::where('id', 'in',$orderId)->where('status', '>', 2)->count():0;
|
|
|
+ $item['count'] = $item['sales'];
|
|
|
}
|
|
|
}
|
|
|
$data['list'] = $list;
|