app/Http/Controllers/admin/GoodImagesController.php
/**
     * Display a listing of the resource.
     *
     * @return \Illuminate\Http\Response
     */
Display a listing of the resource.
@return \Illuminate\Http\Response
Display a listing of the resource . @return \ Illuminate \ Http \ Response
public function index(Request $request)
    {   
        $count = DB::table('jc_goods_images')->whereNull('deleted_at')->count();
        $id = $request->input('search');
        $goods = Goods::orderBy('id','desc')->get();
        if($id){
            $data = GoodImages::where('gid',$id)->orderBy('id','desc')->paginate(8)->appends($request->input());
        }else{   
            $data = GoodImages::orderBy('id','desc')->paginate(8)->appends($request->input());
        }
        return view('admin.goodimages.index',['title'=>'商品详图','data'=>$data,'goods'=>$goods,'count'=>$count]);
    }
public function index ( Request $ request ) { $ count = DB :: table ( 'jc_goods_images' ) -> whereNull ( 'deleted_at' ) -> count ( ) ; $ id = $ request -> input ( 'search' ) ; $ goods = Goods :: orderBy ( 'id' , 'desc' ) -> get ( ) ; if ( $ id ) { $ data = GoodImages :: where ( 'gid' , $ id ) -> orderBy ( 'id' , 'desc' ) -> paginate ( 8 ) -> appends ( $ request -> input ( ) ) ; } else { $ data = GoodImages :: orderBy ( 'id' , 'desc' ) -> paginate ( 8 ) -> appends ( $ request -> input ( ) ) ; } return view ( 'admin.goodimages.index' , [ 'title' => '商品详图','data'= > $data, 'g o ods' = >$goods ,' c ount' = >$count ]) ; }
Display a listing of the resource.
Display a listing of the resource .
//设置计算数据表中所有信息的数量