shceme
This commit is contained in:
parent
9e1fd31e2c
commit
f8982050f4
@ -541,8 +541,9 @@ class OrderController extends Controller
|
|||||||
*/
|
*/
|
||||||
public function orderScheme(Request $request, Order $order)
|
public function orderScheme(Request $request, Order $order)
|
||||||
{
|
{
|
||||||
|
$foodIds = Food::where("type", "FOOD")->pluck("id")->toArray();
|
||||||
$scheme = $order->scheme;
|
$scheme = $order->scheme;
|
||||||
$value = [];
|
$arr = [];
|
||||||
if ($scheme) {
|
if ($scheme) {
|
||||||
$value = $scheme->scheme;
|
$value = $scheme->scheme;
|
||||||
foreach ($value as $item) {
|
foreach ($value as $item) {
|
||||||
@ -551,9 +552,12 @@ class OrderController extends Controller
|
|||||||
$item->name = $food->name;
|
$item->name = $food->name;
|
||||||
}
|
}
|
||||||
$item->model = $scheme->model;
|
$item->model = $scheme->model;
|
||||||
|
if (!in_array($item->id, $foodIds))
|
||||||
|
continue;
|
||||||
|
$arr[] = $item;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $this->success('ok', $value);
|
return $this->success('ok', $arr);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user