fixed
This commit is contained in:
parent
578ac14edf
commit
84a941a1fc
|
@ -129,13 +129,14 @@
|
||||||
public function product(): Json
|
public function product(): Json
|
||||||
{
|
{
|
||||||
$data = Product::field('id as product_id,code,name')->where('status',1)->select()->toArray();
|
$data = Product::field('id as product_id,code,name')->where('status',1)->select()->toArray();
|
||||||
|
$result = [];
|
||||||
foreach ($data as $k=>$v) {
|
foreach ($data as $k=>$v) {
|
||||||
$productDevice = ProductDevice::where('product_id',$v['product_id'])->select()->toArray();
|
$productDevice = ProductDevice::where('product_id',$v['product_id'])->select()->toArray();
|
||||||
if(empty($productDevice)){
|
if(!empty($productDevice)){
|
||||||
unset($data[$k]);
|
$result[] = $v;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $this->success('请求成功',$data);
|
return $this->success('请求成功',$result);
|
||||||
}
|
}
|
||||||
|
|
||||||
//绑定产品
|
//绑定产品
|
||||||
|
|
Loading…
Reference in New Issue