Browse Source

orderBy('supplier_date')

master
李可松 5 years ago
parent
commit
6360fef7b1
  1. 5
      app/AdminAgent/Forms/LoadSupplierSpec.php

5
app/AdminAgent/Forms/LoadSupplierSpec.php

@ -21,6 +21,7 @@ class LoadSupplierSpec extends Form implements LazyRenderable
->pluck('product_spec_id')->toArray(); ->pluck('product_spec_id')->toArray();
$spec = ProductSpec::where('product_id', $id) $spec = ProductSpec::where('product_id', $id)
->whereNotIn('id', $agent_spec ?? [0]) ->whereNotIn('id', $agent_spec ?? [0])
->orderBy('supplier_date')
->get([ ->get([
'id AS product_spec_id', 'id AS product_spec_id',
'name AS supplier_name', 'name AS supplier_name',
@ -29,7 +30,9 @@ class LoadSupplierSpec extends Form implements LazyRenderable
'stock AS supplier_stock', 'stock AS supplier_stock',
])->toArray(); ])->toArray();
} else { } else {
$spec = ProductSpec::where('product_id', $id)->get([
$spec = ProductSpec::where('product_id', $id)
->orderBy('supplier_date')
->get([
'id AS product_spec_id', 'id AS product_spec_id',
'name AS supplier_name', 'name AS supplier_name',
'date AS supplier_date', 'date AS supplier_date',

Loading…
Cancel
Save