lvhao 1 месяц назад
Родитель
Сommit
314bc1b723
1 измененных файлов с 22 добавлено и 8 удалено
  1. 22 8
      core/CoreApp/controllers/Beihuogl.php

+ 22 - 8
core/CoreApp/controllers/Beihuogl.php

@@ -85,6 +85,8 @@ class Beihuogl extends Start_Controller {
             $this->_printlabel();
         }elseif($arg == 'deldyapply'){
             $this->_deldyapply();
+        }elseif($arg == 'dcdjzrk'){
+            $this->_dcdjzrk();
         }
 		else
 		{
@@ -398,13 +400,21 @@ class Beihuogl extends Start_Controller {
             $error_list= [];
             foreach($data as $k=>$v){
                 $shopshortname = trim($v[4]);
-                $shop_info = isset($shop_list[$shopshortname])?$shop_list[$shopshortname]:[];
-                if(empty($shop_info)){
-                    $error_list[] = [
-                        'msg'=>"第".($k+1).'行店铺不存在,请核对表格信息'.$shopshortname,
-                    ];
-                    continue;
+                if($shopshortname == '无'){
+                   $shop_info = [
+                        'id'=>0,
+                        'type'=>0,
+                   ];
+                }else{
+                    $shop_info = isset($shop_list[$shopshortname])?$shop_list[$shopshortname]:[];
+                    if(empty($shop_info)){
+                        $error_list[] = [
+                            'msg'=>"第".($k+1).'行店铺不存在,请核对表格信息'.$shopshortname,
+                        ];
+                        continue;
+                    }
                 }
+                
                 $num = (int)$v[3];
                 if(empty($num)){
                     $error_list[] = [
@@ -450,10 +460,14 @@ class Beihuogl extends Start_Controller {
                     'update_time'=>$time,
                 ];
             }
-
             $r =$this->db->insert_batch('bhsq',$insert_arr);
             if($r){
-                echo json_encode(['success'=>true,'msg'=>'添加成功','error_list'=>$error_list]);
+                if(empty($error_list)){
+                    echo json_encode(['success'=>true,'msg'=>'添加成功']);
+                }else{
+                    echo json_encode(['success'=>true,'msg'=>'添加成功','error_list'=>$error_list]);
+                }
+               
             }else{
                 echo json_encode(['success'=>false,'msg'=>'添加失败','error_list'=>$error_list]);
             }