Browse Source

Merge branch 'wugg-dev' of wugg/phpstock into version1.5

wugg 2 years ago
parent
commit
11fde17936
3 changed files with 3 additions and 7 deletions
  1. 1 1
      app/abutment/controller/Order.php
  2. 0 4
      app/admin/controller/Purch.php
  3. 2 2
      app/common.php

+ 1 - 1
app/abutment/controller/Order.php

@@ -411,7 +411,7 @@ class Order extends HomeBaseController
             foreach ($cgdNo as $vlue) {
             	$isreturn = cgd_sale_return($vlue);
 		        if($isreturn){
-		            return json_show(1005, "{$vlue}关联销售单存在退货单正在进行");
+		        	throw new Exception("{$vlue}关联销售单存在退货单正在进行");
 		        }
                // if($status==1 || $status==2){
 //                    $orderinfo = Db::name('sale')

+ 0 - 4
app/admin/controller/Purch.php

@@ -636,10 +636,6 @@ class Purch extends Base
 
         if (empty($cgdNo)) {
             return error_show(1004, "参数cgdNo 不能为空");
-        }
-		$isreturn = cgd_sale_return($cgdNo);
-        if($isreturn){
-        	return error_show(1005, "销售单存在退货单正在进行");
         }
         $remark = isset($this->post['remark']) && $this->post['remark'] != "" ? trim($this->post['remark']) : "";
         $status = isset($this->post['status']) && $this->post['status'] !== "" ? intval($this->post['status']) : "";

+ 2 - 2
app/common.php

@@ -1400,7 +1400,7 @@ if(!function_exists("cgd_sale_return")){
 		->leftJoin("sale_return b","a.orderCode=b.orderCode and b.is_del=0")
 		->where(["a.cgdNo"=>$cgdNo])
 		->whereIn("b.status",[1,2,3,7])
-		->find()->isExists();
-		return $order;
+		->findOrEmpty();
+		return !empty($order);
 	}
 }