@@ -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')
@@ -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']) : "";
@@ -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);