| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- <?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)
- {
- return true;
- $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)
- {
- return true;
- $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);
- }
- }
- }
|