| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- <?php
- namespace biz\shop\classes;
- use biz\notice\classes\NoticeClass;
- use bizHd\order\classes\OrderClass;
- use bizHd\purchase\classes\PurchaseClass;
- use common\components\dict;
- use linslin\yii2\curl;
- use biz\base\classes\BaseClass;
- class ShopExtClass extends BaseClass
- {
- public static $baseFile = '\biz\shop\models\ShopExt';
- //花店采购供应商端播放声音
- public static function hdCgGhsReport($orderSn)
- {
- $cg = PurchaseClass::getByCondition(['orderSn' => $orderSn], true);
- if (isset($cg->onlinePay) && $cg->onlinePay == dict::getDict('onlinePay', 'yes')) {
- $saleId = $cg->saleId ?? 0;
- $order = \bizGhs\order\classes\OrderClass::getById($saleId, true);
- if (isset($order->needPrint) && $order->needPrint == dict::getDict('needPrint', 'noNeed')) {
- $shopId = $order->shopId ?? 0;
- $shopExt = ShopExtClass::getByCondition(['shopId' => $shopId], true);
- if (isset($shopExt->lbSn) && !empty($shopExt->lbSn)) {
- $actPrice = floatval($order->actPrice) ?? 0;
- $payWay = $order->payWay ?? dict::getDict('payWay', 'wxPay');
- $sound = $payWay == dict::getDict('payWay', 'wxPay') ? "微信收款{$actPrice}元" : "支付宝收款{$actPrice}元";
- $url = "https://speaker.17laimai.cn/notify.php?id={$shopExt->lbSn}&token=HK1626595800&version=3&message=" . $sound;
- $curl = new curl\Curl();
- $curl->get($url);
- }
- }
- //app新订单通知
- NoticeClass::ghsNewOrderNotice($order);
- }
- }
- //零售花店收款声音播放 ssh 20220423
- public static function hdGatheringReport($order)
- {
- if ($order->fromType != dict::getDict("fromType", "shop")) {
- //非门店订单不播报语音
- return false;
- }
- if ($order->needPrint == dict::getDict('needPrint', 'need')) {
- //需要打印小票的不播报语音
- return false;
- }
- if ($order->onlinePay == dict::getDict('onlinePay', 'not')) {
- //非在线支付的不播报
- return false;
- }
- if ($order->payStatus != 1) {
- //还没有付款订单不播报
- return false;
- }
- $shopId = $order->shopId ?? 0;
- $shopExt = ShopExtClass::getByCondition(['shopId' => $shopId], true);
- if (isset($shopExt->lbSn) && !empty($shopExt->lbSn)) {
- $actPrice = floatval($order->actPrice) ?? 0;
- $payWay = $order->payWay ?? dict::getDict('payWay', 'wxPay');
- $sound = $payWay == dict::getDict('payWay', 'wxPay') ? "微信收款{$actPrice}元" : "支付宝收款{$actPrice}元";
- $url = "https://speaker.17laimai.cn/notify.php?id={$shopExt->lbSn}&token=HK1626595800&version=3&message=" . $sound;
- $curl = new curl\Curl();
- $curl->get($url);
- }
- }
- //清除所有小菊
- public static function clearXjALl($shopId)
- {
- $where = [];
- $where['shopId'] = $shopId;
- return self::updateByCondition($where, ['xj' => '']);
- }
- }
|