|
|
@@ -363,37 +363,15 @@ class OrderController extends BaseController
|
|
|
$post['expressId'] = $post['expressId'] ?? 0;
|
|
|
$post['sendCost'] = $post['sendCost'] ?? '0.00';
|
|
|
|
|
|
- //PC端开单
|
|
|
- if (isset($post['clearType'])) {
|
|
|
- $clearType = $post['clearType'];
|
|
|
- if ($clearType == OrderClass::CLEAR_DEBT) {
|
|
|
- $post['debt'] = OrderClass::DEBT_YES;
|
|
|
- $post['payWay'] = dict::getDict('payWay', 'debtPay');
|
|
|
- } else {
|
|
|
- $post['debt'] = OrderClass::DEBT_NO;
|
|
|
- }
|
|
|
+ $hasPay = $post['hasPay'] ?? dict::getDict('hasPay', 'unPay');
|
|
|
+ if ($hasPay == dict::getDict('hasPay', 'debt')) {
|
|
|
+ $post['debt'] = OrderClass::DEBT_YES;
|
|
|
}
|
|
|
|
|
|
- $debt = $post['debt'] ?? OrderClass::DEBT_YES;
|
|
|
-
|
|
|
- //PC端开单
|
|
|
- if (isset($post['getType'])) {
|
|
|
- util::fail('PC端开单未开放');
|
|
|
- $getType = $post['getType'];
|
|
|
- //自取
|
|
|
- if ($getType == 1) {
|
|
|
- $post['sendType'] = OrderClass::SEND_TYPE_NO;
|
|
|
- } else {
|
|
|
- //选择配送时,在发货时让商家自己再确认一下用什么方式
|
|
|
- $post['sendType'] = OrderClass::SEND_TYPE_UNKNOWN;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- //员工不能开已收款订单
|
|
|
- if ($debt == OrderClass::DEBT_NO) {
|
|
|
- $shopAdmin = $this->shopAdmin;
|
|
|
- if (isset($shopAdmin->super) == false || $shopAdmin->super != 1) {
|
|
|
- util::fail('只能开欠款单');
|
|
|
+ $shopAdmin = $this->shopAdmin;
|
|
|
+ if (isset($shopAdmin->super) == false || $shopAdmin->super != 1) {
|
|
|
+ if ($hasPay == dict::getDict('hasPay', 'payed')) {
|
|
|
+ util::fail('没有权限');
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -416,7 +394,6 @@ class OrderController extends BaseController
|
|
|
$validTime = dict::getDict('kd_order_valid');
|
|
|
$current = time() + $validTime;
|
|
|
$post['deadline'] = date("Y-m-d H:i:s", $current);
|
|
|
- $hasPay = $post['hasPay'] ?? 1;
|
|
|
$return = OrderService::createOrder($post, $custom, $hasPay);
|
|
|
$transaction->commit();
|
|
|
util::success($return);
|