|
|
@@ -1493,11 +1493,15 @@ class Beihuogl extends Start_Controller {
|
|
|
$data = $this->input->post(null,true);
|
|
|
$dcd_no = $data['dcd_no'];
|
|
|
$drd_no = $data['drd_no'];
|
|
|
- $list = $this->bhdcd->find_all("dcd_no = '".$dcd_no."' and drd_no = '".$drd_no."' and is_rk = 0");
|
|
|
-
|
|
|
+ $list = $this->bhdcd->find_all("dcd_no = '".$dcd_no."' and is_rk = 0");
|
|
|
$whlabel_arr = [];
|
|
|
$time = time();
|
|
|
+ $err_list= [];
|
|
|
foreach($list as $k=>$v){
|
|
|
+ if(empty($v['sku'])){
|
|
|
+ $err_list[] = $v['jm']."不存在";
|
|
|
+ continue;
|
|
|
+ }
|
|
|
for($i=0;$i<$v['num'];$i++){
|
|
|
$whlabel_arr[] = [
|
|
|
'sku'=>$v['sku'],
|
|
|
@@ -1517,10 +1521,13 @@ class Beihuogl extends Start_Controller {
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+ if(!empty($err_list)){
|
|
|
+ echo json_encode(['success'=>false,'msg'=>implode('<br/>', $err_list)]);exit;
|
|
|
+ }
|
|
|
$this->db->trans_start();
|
|
|
$this->db->insert_batch('whlabel',$whlabel_arr);
|
|
|
$this->db->where('dcd_no',$dcd_no);
|
|
|
- $this->db->where('drd_no',$drd_no);
|
|
|
+ //$this->db->where('drd_no',$drd_no);
|
|
|
$this->db->update('bhdcd',['status'=>3,'rk_time'=>$time,'is_rk'=>1]);
|
|
|
|
|
|
if($this->db->trans_status() === FALSE){
|