|
|
@@ -1223,12 +1223,28 @@ class OrderController extends BaseController
|
|
|
$priceMap = CustomClass::$levelPriceKeyMap;
|
|
|
$addPriceMap = CustomClass::$levelAddPriceKeyMap;
|
|
|
$level = $custom['level'] ?? 1;
|
|
|
- foreach ($productList as $currentKey => $currentProduct) {
|
|
|
+ foreach ($productList as $currentProduct) {
|
|
|
$currentPrice = $currentProduct['price'] ?? 0;
|
|
|
$currentId = $currentProduct['productId'] ?? 0;
|
|
|
$systemInfo = $itemInfo[$currentId] ?? [];
|
|
|
$name = $systemInfo['name'] ?? '';
|
|
|
$systemPrice = ProductClass::getFinalPrice($systemInfo, $level, $priceMap, $addPriceMap);
|
|
|
+
|
|
|
+ if (getenv('YII_ENV') == 'production') {
|
|
|
+ //苏州小蔡鲜花,几个出车,不能低于原价卖,但可以高于原价卖的
|
|
|
+ if (in_array($shopId, [38231, 38143, 29163, 29161])) {
|
|
|
+ if ($currentPrice < $systemPrice) {
|
|
|
+ util::fail('不能低于原价卖');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (in_array($shopId, [36544])) {
|
|
|
+ if ($currentPrice < $systemPrice) {
|
|
|
+ util::fail('不能低于原价卖');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
if (floatval($currentPrice) != floatval($systemPrice)) {
|
|
|
$diff[] = [
|
|
|
'name' => $name,
|
|
|
@@ -1311,36 +1327,8 @@ class OrderController extends BaseController
|
|
|
$shop = ShopClass::getById($shopId, true);
|
|
|
if (isset($order->payStatus) && $order->payStatus == 1) {
|
|
|
if (!empty($shop)) {
|
|
|
-/*
|
|
|
- //通知员工
|
|
|
- $noticeText = json_encode(['orderId' => $saleId]);
|
|
|
- $noticeKey = "hdCgNoticeGhs";
|
|
|
- Yii::$app->redis->executeCommand('LPUSH', [$noticeKey, $noticeText]);
|
|
|
-
|
|
|
- //通知花店
|
|
|
- //$noticeText = json_encode(['id' => $order->purchaseId]);
|
|
|
- //$noticeKey = "ghsKdNoticeHd";
|
|
|
- //Yii::$app->redis->executeCommand('LPUSH', [$noticeKey, $noticeText]);
|
|
|
-
|
|
|
- Yii::info('向花店App发通知');
|
|
|
- //$custom = CustomClass::getById($order->customId);
|
|
|
- //$customShop = ShopClass::getById($custom['shopId'], true, 'merchantName, shopName');
|
|
|
- //向花店App发通知
|
|
|
- $allDevices = \bizHd\device\classes\HdDeviceClass::getAllByCondition(['shopId'=>$custom['shopId']]);
|
|
|
- $cids = array_column($allDevices, 'clientId');
|
|
|
- $title = '买花成功';
|
|
|
- $shopName = $shop->merchantName . ($shop->shopName != '首店' ? '(' . $shop->shopName . ')' : '');
|
|
|
- $content = $shopName . ' ¥' . $order->actPrice;
|
|
|
- $payload = [
|
|
|
- "page" => "pagesPurchase/purDetails",
|
|
|
- "params" => ["id" => $order->purchaseId]
|
|
|
- ];
|
|
|
- $push = new push('hd', push::MSG_TYPE_ORDER);
|
|
|
- $push->pushByCloud($cids, $title, $content, $payload);
|
|
|
-*/
|
|
|
GhsNotifyClass::newOrderNotify($saleId);
|
|
|
HdNotifyClass::newCgNotify($order->purchaseId);
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
//订单生成时唤起在线打印
|