| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- <?php
- namespace biz\notice\classes;
- use biz\admin\classes\AdminClass;
- use biz\base\classes\BaseClass;
- use biz\shop\classes\ShopAdminClass;
- use biz\shop\classes\ShopClass;
- use common\components\pushNotice;
- use Yii;
- class NoticeClass extends BaseClass
- {
- //城市供应商新订单通知 ssh 20210115
- public static function ghsNewOrderNotice($order)
- {
- //app消息通知
- $shopId = $order->shopId ?? 0;
- $shop = ShopClass::getById($shopId, true);
- if (empty($shop)) {
- return false;
- }
- $adminList = ShopAdminClass::getRemainAdmin($shop);
- if (empty($adminList)) {
- return false;
- }
- $customName = $order->customName ?? '';
- $actPrice = $order->actPrice ?? 0;
- foreach ($adminList as $admin) {
- $clientId = $admin['clientId'] ?? '';
- if (empty($clientId)) {
- continue;
- }
- pushNotice::gtPush($clientId, '新订单通知', $customName . '下单' . $actPrice . '元');
- }
- }
- //提现审核通过通知所有人 ssh 20210115
- public static function cashPassNotice($shop, $cash)
- {
- $ptStyle = $shop->ptStyle;
- $amount = $cash->amount;
- Yii::$app->params['ptStyle'] = $ptStyle;
- $shopAdminId = $cash->shopAdminId ?? 0;
- $staff = ShopAdminClass::getById($shopAdminId, true);
- if (empty($staff)) {
- return false;
- }
- $adminId = $staff->adminId ?? 0;
- $admin = AdminClass::getById($adminId, true);
- if (empty($admin)) {
- return false;
- }
- $clientId = $admin['clientId'] ?? '';
- if (empty($clientId)) {
- return false;
- }
- pushNotice::gtPush($clientId, '提现到账通知', $amount . '元已到账,请查收');
- }
- //新客户通知 ssh 20210115
- public static function newCustomNotice($shop, $custom)
- {
- $ptStyle = $shop['ptStyle'] ?? 1;
- $name = $custom['name'] ?? '';
- Yii::$app->params['ptStyle'] = $ptStyle;
- $id = $shop['id'] ?? 0;
- $newShop = ShopClass::getById($id, true);
- if (empty($newShop)) {
- return false;
- }
- $adminList = ShopAdminClass::getRemainAdmin($newShop);
- if (empty($adminList)) {
- return false;
- }
- foreach ($adminList as $admin) {
- $clientId = $admin['clientId'] ?? '';
- if (empty($clientId)) {
- continue;
- }
- pushNotice::gtPush($clientId, '新客户加入', $name);
- }
- }
- }
|