shish 1 год назад
Родитель
Сommit
fd3d8635a5

+ 12 - 12
app-hd/controllers/OrderController.php

@@ -369,20 +369,20 @@ class OrderController extends BaseController
         //默认情况开单员工和收款员工是同个人
         $staffId = $this->shopAdminId ?? 0;
         $staffName = $this->shopAdmin->name ?? '';
-        if (isset($post['shopAdminId']) == false || empty($post['shopAdminId'])) {
+        if (empty($post['shopAdminId'])) {
             $post['shopAdminId'] = $staffId;
             $post['shopAdminName'] = $staffName;
         }
-        if (isset($post['getStaffId']) == false || empty($post['getStaffId'])) {
+        if (empty($post['getStaffId'])) {
             $post['getStaffId'] = $staffId;
             $post['getStaffName'] = $this->shopAdmin->name ?? '';
         }
-        $groupId = isset($post['groupId']) && !empty($post['groupId']) ? $post['groupId'] : 0;
+        $groupId = !empty($post['groupId']) ? $post['groupId'] : 0;
 
         $post['fromType'] = $post['fromType'] ?? 1;
 
         if ($post['fromType'] == dict::getDict('fromType', 'friend')) {
-            if (isset($post['bookName']) == false || empty($post['bookName'])) {
+            if (empty($post['bookName'])) {
                 util::fail('请填写订花人姓名');
             }
         }
@@ -400,13 +400,13 @@ class OrderController extends BaseController
         $post['customName'] = $customName;
         $post['customNamePy'] = stringUtil::py($customName);
 
-        if (isset($post['receiveMobile']) && !empty($post['receiveMobile'])) {
-            if (stringUtil::isMobile($post['receiveMobile']) == false) {
+        if (!empty($post['receiveMobile'])) {
+            if (!stringUtil::isMobile($post['receiveMobile'])) {
                 util::fail('请填写正确的收花人手机号');
             }
         }
-        if (isset($post['bookMobile']) && !empty($post['bookMobile'])) {
-            if (stringUtil::isMobile($post['bookMobile']) == false) {
+        if (!empty($post['bookMobile'])) {
+            if (!stringUtil::isMobile($post['bookMobile'])) {
                 util::fail('请填写正确的订花人手机号');
             }
         }
@@ -425,9 +425,9 @@ class OrderController extends BaseController
         }
         if (empty($productList) && empty($groupId)) {
             //商家手机上开单并生成制作单
-            if (isset($post['unitGoodsPrice']) && !empty($post['unitGoodsPrice'])) {
+            if (!empty($post['unitGoodsPrice'])) {
                 $unitGoodsPrice = $post['unitGoodsPrice'];
-                if (is_numeric($unitGoodsPrice) == false) {
+                if (!is_numeric($unitGoodsPrice)) {
                     util::fail('请输入正确的单价');
                 }
                 $productList = GoodsClass::orderCreateGoods($post);
@@ -435,9 +435,9 @@ class OrderController extends BaseController
         }
 
         if (empty($productList) && empty($groupId)) {
-            if (isset($post['lsGoodsPrice']) == false || $post['lsGoodsPrice'] <= 0) {
+            if ($post['lsGoodsPrice'] <= 0) {
                 $lsGoodsPrice = $post['lsGoodsPrice'];
-                if (is_numeric($lsGoodsPrice) == false) {
+                if (!is_numeric($lsGoodsPrice)) {
                     util::fail('请输入正确的金额');
                 }
                 util::fail('请填写金额或选商品');

+ 4 - 4
biz-hd/order/services/OrderService.php

@@ -75,7 +75,7 @@ class OrderService extends BaseService
             }
         }
         if (empty($product)) {
-            if (isset($data['lsGoodsPrice']) == false || $data['lsGoodsPrice'] <= 0) {
+            if (!isset($data['lsGoodsPrice']) || $data['lsGoodsPrice'] <= 0) {
                 util::fail('没有商品');
             }
         }
@@ -117,7 +117,7 @@ class OrderService extends BaseService
         $manyType = count($product) > 1 ? 1 : 0;
 
         foreach ($product as $key => $val) {
-            if (isset($val['property']) == false) {
+            if (!isset($val['property'])) {
                 util::fail('没有找到产品属性');
             }
             $property = $val['property'];
@@ -322,8 +322,8 @@ class OrderService extends BaseService
         //保存订单
         $returnOrder = OrderClass::addOrder($data);
 
-        //欠款和已付款的直接完成,另外客服下的单要走配送流程,所以是待配送状态
-        if (in_array($hasPay, [dict::getDict('hasPay', 'payed'), dict::getDict('hasPay', 'debt')])) {
+        //欠款、已付款、余额支付的直接完成,另外客服下的单要走配送流程,所以是待配送状态
+        if (in_array($hasPay, [dict::getDict('hasPay', 'payed'), dict::getDict('hasPay', 'debt'), dict::getDict('hasPay', 'balance')])) {
             OrderClass::payAfter($returnOrder, $payWay);
         }
 

+ 2 - 0
common/components/dict.php

@@ -138,6 +138,8 @@ class dict
             'debt' => 2,
             //现金
             'cash' => 3,
+            //余额
+            'balance'=>4,
         ],
         'hasPayMap' => [