Merge branch 'master' into dev

This commit is contained in:
LI JIAHAO
2017-06-14 19:41:55 +08:00
4 changed files with 17 additions and 22 deletions
+4 -3
View File
@@ -17,11 +17,12 @@ class ContentController extends Controller
{
$data = [];
$data['cats'] = GoodCat::orderby('cat_index', 'asc')->get();
$data['stargoods'] = GoodInfo::where('baned', '0')->where('stared', '1')->orderby('id', 'asc')->limit(5)->get();
$data['newgoods'] = GoodInfo::where('baned', '0')->where('count', '>', 0)->orderby('id', 'dsc')->orderby('id', 'dsc')->limit(12)->get();
$data['stargoods'] = GoodInfo::where('baned', false)->where('stared', '1')->orderby('id', 'asc')->limit(5)->get();
$data['newgoods'] = GoodInfo::where('baned', false)->where('count', '>', 0)->orderby('id', 'dsc')->limit(8)->get();
$data['populargoods'] = GoodInfo::where('baned', false)->where('count', '>', 0)->where('fav_num', '>', 0)->orderby('fav_num', 'desc')->limit(8)->get();
$data['cats'] = GoodCat::orderby('cat_index', 'asc')->get();
foreach($data['cats'] as $cat){
$data['catgoods'][$cat->cat_name] = GoodInfo::where('cat_id', $cat->id)->where('baned', '0')->inRandomOrder()->limit(6)->get();
$data['catgoods'][$cat->cat_name] = GoodInfo::where('cat_id', $cat->id)->where('baned', false)->inRandomOrder()->limit(4)->get();
}
$data['announces'] = Announcement::orderby('id', 'dsc')->limit(5)->get();
return View::make('welcome')->with($data);
+1 -1
View File
@@ -242,7 +242,7 @@ class UserController extends Controller
{
$data = [];
$user_id = $request->session()->get('user_id');
$data['goods'] = GoodInfo::where('user_id', $user_id)->paginate(15);
$data['goods'] = GoodInfo::where('user_id', $user_id)->orderby('id', 'desc')->paginate(15);
return view::make('user.seller.mygoods')->with($data);
}