wugg 1 year ago
parent
commit
7cf40ed6b5

+ 1 - 1
app/admin/command/GetOrderInfoAndInvoiceInfo.php

@@ -79,7 +79,7 @@ class GetOrderInfoAndInvoiceInfo extends Command
 		}catch (\Exception $exception){
 			Cache::store("redis")->set("generrateinvoice",0);
 			Db::rollback();
-			$output->writeln( "【 $date 】开票申请失败".$exception->getMessage().$exception->getLine());
+			$output->writeln( "【 $date 】开票申请失败".$exception->getMessage().$exception->getLine().$exception->getFile());
 		}
 
 		 Cache::store("redis")->set("GetOrderInfoAndInvoiceInfo",0);

+ 3 - 1
app/admin/controller/ComonOrder.php

@@ -40,7 +40,7 @@ class ComonOrder extends Base
     public function list(){
         $post = $this->request->only(["start"=>"","end"=>"","cxCode"=>"","orderCode"=>[],"customerNo"=>"",
         "companyNo"=>"",'status'=>[],'relaComNo'=>'','platform_type'=>'','inv_status'=>'','pay_status'=>'', 'page'=>1,'size'=>15],"post","trim");
-        $where=[];
+        $where=[["qrd.is_del","=",0],['cgd.is_del','=',0]];
         $post['start']==''?:$where[]=["comon_order.addtime",">=",date("Y-m-d 00:00:00",strtotime($post['start']))];
         $post['end']==''?:$where[]=["comon_order.addtime","<=",date("Y-m-d 23:59:59",strtotime($post['end']))];
         $post['cxCode']==''?:$where[]=["comon_order.cxCode","like","%{$post['cxCode']}%"];
@@ -263,6 +263,8 @@ class ComonOrder extends Base
         if($pay->isEmpty())$this->error('对账单订单数据未找到');
         $cgdlist = [];
         $qrdlist = [];
+        $list=$this->model->with(['qrd','cgd'])->where(['cgdNo'=>array_column($pay->toArray(),"cgdNo")])->select()
+        ->toArray();
         foreach ($pay as $item){
         	$list=$this->model->with(['qrd',"cgd"])->where(["cgdNo"=>$item->cgdNo])->findOrEmpty();
         	if($list->isEmpty())continue;

+ 4 - 4
app/admin/controller/Good.php

@@ -7,7 +7,7 @@ use app\admin\model\GoodChange;use think\App;use think\facade\Validate;
 class Good extends Base
 {
 	protected $model=null;
-//	protected $novalidate=["*"];
+	#protected $novalidate=["*"];
     public function __construct(App $app) {
     	parent::__construct($app);
     	$this->model=new \app\admin\model\Good();
@@ -91,7 +91,7 @@ class Good extends Base
         	    $temp['addTax']= $item['addTax'];
         	    $temp['inv_tag']= $item['inv_tag'];
         	    $temp['tax_diff']= $tax==$good->cgd_inv_tax?1:2;
-        	    $temp['cat_diff']= $temp['inv_cat_code']==$good->cgd_inv_cat_code?1:2;
+        	    $temp['cat_diff']=intval($catArr[$item['cat_code']]['merge_code'])==intval($good->cgd_inv_cat_code)?1:2;
         	}
         	$check = $this->checkChange($good,$temp);
         	if(!empty($check)){
@@ -103,7 +103,7 @@ class Good extends Base
         	$temp['exam_info'] = json_encode($examinfo,JSON_UNESCAPED_UNICODE);
         	$goodUpdate[]=$temp;
         }
-        $this->model->saveAll($goodUpdate);
+        $up=$this->model->saveAll($goodUpdate);
         $this->success("更新成功");
     }
     //商品信息
@@ -177,7 +177,7 @@ class Good extends Base
         if($check['status']==1){
         	$before=[];
         	$after=[];
-        	    if($good->cgd_inv_cat_code!=""&&$check['cgd_inv_cat_code']!=$good->cgd_inv_cat_code){
+        	    if($good->cgd_inv_cat_code!=""&&intval($check['cgd_inv_cat_code'])!=intval($good->cgd_inv_cat_code)){
         	        $before['inv_cat_code']  = $good->cgd_inv_cat_code;
         	        $after['inv_cat_code']  = $check['cgd_inv_cat_code'];
         	    }

+ 11 - 0
app/admin/controller/Track.php

@@ -284,5 +284,16 @@ class Track extends Base
         }
         $this->success('更新成功');
 	}
+	
+	public function delete(){
+	   $param=$this->request->param(['id'=>''],'post','trim');
+        $valid=Validate::rule(['id'=>'require|number|gt:0']);
+        if($valid->check($param)==false)$this->error($valid->getError());
+        $info=$this->model->order('id desc')->findOrEmpty($param['id']);
+        if($info->isEmpty()) $this->error("未找到数据");
+        if($info->status!=0)$this->error('运单状态对账中');
+        $del= $info->delete();
+        $del? $this->success('删除成功'):$this->error('删除失败');
+	}
 }
 

+ 1 - 2
app/admin/listener/ComonQrd.php

@@ -80,7 +80,7 @@ class ComonQrd
     	$payinfo = Pay::where('payNo',$invpay['payNo'])->findOrEmpty();
     	if($payinfo->isEmpty()) return;
     	if($payinfo->is_comon!=1)return;
-    	$ticket =InvoiceTicket::where(["invNo"=>$data['invNo'],"type"=>0])->findOrEmpty();
+    	$ticket =InvoiceTicket::where(["invNo"=>$data['invNo'],"type"=>0])->json(['item'])->findOrEmpty();
     	if($ticket->isEmpty())return;
     	$pay_fee=0;
     	    	if($payinfo->winv_fee >=$invinfo->inv_value){
@@ -114,7 +114,6 @@ class ComonQrd
     	$payinfo->inv_status = ($payinfo->winv_fee==0 &&$payinfo->inv_fee==0)?3:($payinfo->ainv_fee==0?1:2);
     	$this->CheckComonOrder($payinfo);
     	$payinfo->save();
-    	PayInvoice::create($payinvoice);
     	PayInvoice::create($payinvoice);
     	    	if(!empty($ticket->item)){
     	    		$itemArr=[];