|
หัวข้อ: เขียน Laravel Chunk Query Builder อย่างไรครับ เริ่มหัวข้อโดย: hideto ที่ 09 กุมภาพันธ์ 2017, 01:19:33 $users = DB::table('products')->orderBy($sortbysql, $sortbysqltype)
-> where('product_name', 'like', '%' . $keyword . '%') -> where('product_status', '=','1') -> paginate($view); $querylistbrand = DB::table('products')->select('product_brand_name', DB::raw('count(*) as total')) -> where('product_name', 'like', '%' . $keyword . '%') -> where('product_status', '=','1') -> groupBy('product_brand_name') -> orderBy('total', 'desc')->take(25)->get(); หัวข้อ: Re: เขียน Laravel Chunk Query Builder อย่างไรครับ เริ่มหัวข้อโดย: userhuman ที่ 15 กุมภาพันธ์ 2017, 13:53:12 ->chuck(8); อย่างนี้มันก็จะออกมาเป็น Array 2 ตัว แล้วนิครับ :P หรือผมพลาดตรงไหน
หัวข้อ: Re: เขียน Laravel Chunk Query Builder อย่างไรครับ เริ่มหัวข้อโดย: puchong ที่ 15 กุมภาพันธ์ 2017, 15:39:24 ติดตั้ง Extension Laravel TestTools เลยครับ
แล้วชีวิตจะง่ายขึ้น |