NoticeClass.php 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <?php
  2. namespace biz\notice\classes;
  3. use biz\admin\classes\AdminClass;
  4. use biz\base\classes\BaseClass;
  5. use biz\shop\classes\ShopAdminClass;
  6. use biz\shop\classes\ShopClass;
  7. use common\components\pushNotice;
  8. use Yii;
  9. class NoticeClass extends BaseClass
  10. {
  11. //城市供货商新订单通知 ssh 20210115
  12. public static function ghsNewOrderNotice($order)
  13. {
  14. //app消息通知
  15. $shopId = $order->shopId ?? 0;
  16. $shop = ShopClass::getById($shopId, true);
  17. if (empty($shop)) {
  18. return false;
  19. }
  20. $adminList = ShopAdminClass::getRemainAdmin($shop);
  21. if (empty($adminList)) {
  22. return false;
  23. }
  24. $customName = $order->customName ?? '';
  25. $actPrice = $order->actPrice ?? 0;
  26. foreach ($adminList as $admin) {
  27. $clientId = $admin['clientId'] ?? '';
  28. if (empty($clientId)) {
  29. continue;
  30. }
  31. pushNotice::gtPush($clientId, '新订单通知', $customName . '下单' . $actPrice . '元');
  32. }
  33. }
  34. //提现审核通过通知所有人 ssh 20210115
  35. public static function cashPassNotice($shop, $cash)
  36. {
  37. return true;
  38. $ptStyle = $shop->ptStyle;
  39. $amount = $cash->amount;
  40. Yii::$app->params['ptStyle'] = $ptStyle;
  41. $shopAdminId = $cash->shopAdminId ?? 0;
  42. $staff = ShopAdminClass::getById($shopAdminId, true);
  43. if (empty($staff)) {
  44. return false;
  45. }
  46. $adminId = $staff->adminId ?? 0;
  47. $admin = AdminClass::getById($adminId, true);
  48. if (empty($admin)) {
  49. return false;
  50. }
  51. $clientId = $admin['clientId'] ?? '';
  52. if (empty($clientId)) {
  53. return false;
  54. }
  55. //pushNotice::gtPush($clientId, '提现到账通知', $amount . '元已到账,请查收');
  56. }
  57. //新客户通知 ssh 20210115
  58. public static function newCustomNotice($shop, $custom)
  59. {
  60. return true;
  61. $ptStyle = $shop['ptStyle'] ?? 1;
  62. $name = $custom['name'] ?? '';
  63. Yii::$app->params['ptStyle'] = $ptStyle;
  64. $id = $shop['id'] ?? 0;
  65. $newShop = ShopClass::getById($id, true);
  66. if (empty($newShop)) {
  67. return false;
  68. }
  69. $adminList = ShopAdminClass::getRemainAdmin($newShop);
  70. if (empty($adminList)) {
  71. return false;
  72. }
  73. foreach ($adminList as $admin) {
  74. $clientId = $admin['clientId'] ?? '';
  75. if (empty($clientId)) {
  76. continue;
  77. }
  78. //pushNotice::gtPush($clientId, '新客户加入', $name);
  79. }
  80. }
  81. }