|
|
@@ -2,16 +2,19 @@
|
|
|
|
|
|
namespace App\Services;
|
|
|
|
|
|
+use App\Owner;
|
|
|
use App\Services\common\QueryService;
|
|
|
+use App\User;
|
|
|
use App\Waybill;
|
|
|
use Illuminate\Http\Request;
|
|
|
+use Illuminate\Support\Facades\Auth;
|
|
|
use Illuminate\Support\Facades\DB;
|
|
|
use Ramsey\Uuid\Uuid;
|
|
|
|
|
|
Class WaybillService
|
|
|
{
|
|
|
private function conditionQuery(Request $request){
|
|
|
- $waybills = Waybill::with(['owner','wmsCommodities','waybillAuditLogs' => function ($query) {
|
|
|
+ $waybills = Waybill::filterAuthorities()->with(['owner','wmsCommodities','waybillAuditLogs' => function ($query) {
|
|
|
return $query->with('user');
|
|
|
}])->selectRaw('waybills.* ,waybill_on_tops.id top_id ,waybill_on_tops.remark,waybill_on_tops.updated_at top_update')
|
|
|
->leftJoin('waybill_on_tops','waybill_on_tops.waybill_id','=','waybills.id')
|
|
|
@@ -44,7 +47,7 @@ Class WaybillService
|
|
|
}
|
|
|
|
|
|
public function some(Request $request){
|
|
|
- return $waybills = Waybill::with(['owner'])->selectRaw('waybills.* ,waybill_on_tops.id top_id ,waybill_on_tops.remark,waybill_on_tops.updated_at top_update')
|
|
|
+ return $waybills = Waybill::filterAuthorities()->with(['owner'])->selectRaw('waybills.* ,waybill_on_tops.id top_id ,waybill_on_tops.remark,waybill_on_tops.updated_at top_update')
|
|
|
->leftJoin('waybill_on_tops','waybill_on_tops.waybill_id','=','waybills.id')
|
|
|
->whereNull('waybill_on_tops.deleted_at')
|
|
|
->orderBy('waybill_on_tops.updated_at','desc')
|
|
|
@@ -114,6 +117,7 @@ Class WaybillService
|
|
|
}
|
|
|
sign:
|
|
|
$waybill->fill($request->input());
|
|
|
+ $waybill->update();
|
|
|
return $waybill;
|
|
|
}
|
|
|
}
|