Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $query = DB::table('autostk')
- ->where('autostk.branchid', $branch_id)
- ->where('autostk.itemcode',$request->itemcode)
- ->whereDate('autostk.date','<=',$request->tdate)
- ->leftjoin('journal AS j', function($join) use ($branch_id) {
- $join->on('autostk.refno', '=', 'j.vno')
- ->where('j.code', '>=', 100)
- ->where('j.branchid', $branch_id)
- ->where('j.vtype', '=', 'autostk.vtype')
- ->leftjoin('accounts', 'j.code', '=', 'accounts.code')
- ->where('accounts.branchid', $branch_id);
- })
- ->select('j.code','accounts.title','autostk.*')
- ->orderBY('date')->get()
- ->map(function ($item, $key) {
- return (array) $item;
- })
- ->all();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement