|
|
@@ -628,14 +628,26 @@ class OrderController extends BaseController
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if (empty($productList) && empty($groupId)) {
|
|
|
- if ($post['lsGoodsPrice'] <= 0) {
|
|
|
- $lsGoodsPrice = $post['lsGoodsPrice'];
|
|
|
- if (!is_numeric($lsGoodsPrice)) {
|
|
|
- util::fail('请输入正确的金额');
|
|
|
- }
|
|
|
- util::fail('请填写金额或选商品');
|
|
|
+ //直接收款
|
|
|
+ $zjGathering = $post['zjGathering'] ?? 0;
|
|
|
+ if ($zjGathering == 1) {
|
|
|
+ $lsGoodsPrice = $post['lsGoodsPrice'] ?? 0;
|
|
|
+ if (!is_numeric($lsGoodsPrice) || $lsGoodsPrice <= 0) {
|
|
|
+ util::fail('请填写价格');
|
|
|
+ }
|
|
|
+ //直接收款不需要打印小票
|
|
|
+ $post['needPrint'] = dict::getDict('needPrint', 'noNeed');
|
|
|
+ $shopId = $this->shopId;
|
|
|
+ $ext = ShopExtClass::getByCondition(['shopId' => $shopId], true);
|
|
|
+ $gatheringItem = !empty($ext) ? $ext->gatheringItem : 0;
|
|
|
+ if (empty($gatheringItem)) {
|
|
|
+ util::fail('请设置付款用的商品');
|
|
|
+ }
|
|
|
+ $gatheringItemInfo = ProductClass::getById($gatheringItem, true);
|
|
|
+ if (empty($gatheringItemInfo)) {
|
|
|
+ util::fail('付款用的商品没有设置');
|
|
|
}
|
|
|
+ $productList = [['productId' => $gatheringItem, 'unitType' => 0, 'num' => 1, 'property' => '1', 'unitPrice' => $lsGoodsPrice]];
|
|
|
}
|
|
|
|
|
|
$connection = Yii::$app->db;
|