|
|
@@ -19,11 +19,6 @@ class QcodeAdd extends Backend
|
|
|
{
|
|
|
/**
|
|
|
* 首页展示
|
|
|
- * @return string|\think\response\Json
|
|
|
- * @throws \think\Exception
|
|
|
- * @throws \think\db\exception\DataNotFoundException
|
|
|
- * @throws \think\db\exception\ModelNotFoundException
|
|
|
- * @throws \think\exception\DbException
|
|
|
*/
|
|
|
public function index()
|
|
|
{
|
|
|
@@ -64,6 +59,8 @@ class QcodeAdd extends Backend
|
|
|
echo "创建集合 {$tableName} 失败:" . $e->getMessage();
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
// $product_id = $company->name((int)$userinfo['company'].'_'.'qcode_company')->where('delete_time','')->column('product_id');
|
|
|
// echo "<pre>";
|
|
|
// print_r($product_id);
|
|
|
@@ -73,9 +70,6 @@ class QcodeAdd extends Backend
|
|
|
// $list = $product->where('_id',$v)->where('delete_time','')->find();
|
|
|
// $product_name[$list['product_code']] = $list['product_name'];
|
|
|
// }
|
|
|
-// echo "<pre>";
|
|
|
-// print_r($product_name);
|
|
|
-// echo "<pre>";
|
|
|
// $this->view->assign('product', $product_name);
|
|
|
|
|
|
// 1. 获取所有产品的 ID
|
|
|
@@ -94,8 +88,8 @@ class QcodeAdd extends Backend
|
|
|
if ($list) {
|
|
|
// 记录完整产品信息
|
|
|
$product_info[$list['product_code']] = [
|
|
|
- 'jjcp_cpmc' => $list['product_name'], // 产品名称
|
|
|
- 'jjcp_cpdh' => $list['product_code'], // 产品代码
|
|
|
+ 'jjcp_cpmc' => $list['product_name'],
|
|
|
+ 'jjcp_cpdh' => $list['product_code'],
|
|
|
];
|
|
|
}
|
|
|
}
|
|
|
@@ -115,25 +109,22 @@ class QcodeAdd extends Backend
|
|
|
$matched_products[] = [
|
|
|
'jjcp_cpmc' => $item['jjcp_cpmc'],
|
|
|
'jjcp_cpdh' => $item['jjcp_cpdh'],
|
|
|
- 'order_ddbh' => $mp['order_ddbh'], // 从 MongoDB 查找
|
|
|
- 'jjcp_gdbh' => $mp['jjcp_gdbh'], // 从 MongoDB 查找
|
|
|
- 'jjcp_sl' => $mp['jjcp_sl'], // 从 MongoDB 查找
|
|
|
+ 'order_ddbh' => $mp['order_ddbh'],
|
|
|
+ 'jjcp_gdbh' => $mp['jjcp_gdbh'],
|
|
|
+ 'jjcp_sl' => $mp['jjcp_sl'],
|
|
|
'product_code' => $code,
|
|
|
];
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
$this->view->assign('product', $matched_products);
|
|
|
+
|
|
|
$this->view->assign('row',$data);
|
|
|
return $this->view->fetch();
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 获取产品信息
|
|
|
- * @return \think\response\Json
|
|
|
- * @throws \think\db\exception\DataNotFoundException
|
|
|
- * @throws \think\db\exception\ModelNotFoundException
|
|
|
- * @throws \think\exception\DbException
|
|
|
*/
|
|
|
public function product(){
|
|
|
$QcodeProduct = new QcodeProduct();
|
|
|
@@ -169,10 +160,6 @@ class QcodeAdd extends Backend
|
|
|
|
|
|
/**
|
|
|
* 增加新批次
|
|
|
- * @return void
|
|
|
- * @throws \think\db\exception\DataNotFoundException
|
|
|
- * @throws \think\db\exception\ModelNotFoundException
|
|
|
- * @throws \think\exception\DbException
|
|
|
*/
|
|
|
public function add()
|
|
|
{
|