shen 1 жил өмнө
parent
commit
b3fde41533

+ 1 - 1
app/Http/Controllers/StoreGoodsController.php

@@ -47,7 +47,7 @@ class StoreGoodsController extends Controller{
         $type=$request->input('type');
         $user_id=Auth::user()->id;
         $store_id=Store::where('user_id',$user_id)->value('id');
-        $goods=StoreGoods::where('is_delete',0)->where('is_shelves',1)->select('id','name','img','price','vip_price','main_attr')->orderBy('id')->get();
+        $goods=StoreGoods::where('is_delete',0)->where('is_shelves',1)->select('id','name','img','price','vip_price','main_attr')->orderByDesc('sort')->orderBy('id')->get();
         $inventory=InventoryW::where('store_id',$store_id)->pluck('num',DB::raw("CONCAT(store_id,'_',goods_id,'_',sku_id)"))->toArray();
         foreach($goods as $key=>$val){
             $goods[$key]->imgs=str_replace('http://','https://',$val->img);