NotifyClass.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. namespace bizGhs\notify\classes;
  3. use bizGhs\base\classes\BaseClass;
  4. use bizGhs\custom\classes\CustomClass;
  5. use bizGhs\shop\classes\ShopAdminClass;
  6. use Yii;
  7. class NotifyClass extends BaseClass
  8. {
  9. public static $baseFile = '\bizGhs\notify\models\Notify';
  10. public static function getNotifyList($where)
  11. {
  12. $data = self::getList('*', $where, 'addTime DESC');
  13. return $data;
  14. }
  15. //新增售后申请通过 ssh 20230814
  16. public static function addRefundApplyNotify($refund)
  17. {
  18. $mainId = $refund->mainId ?? 0;
  19. $shopId = $refund->shopId ?? 0;
  20. $title = '有新的售后申请';
  21. $id = $refund->id;
  22. $customId = $refund->customId;
  23. $custom = CustomClass::getById($customId, true);
  24. $customName = $custom->name ?? '';
  25. $staffList = ShopAdminClass::getAllByCondition(['mainId' => $mainId], null, '*', null, true);
  26. if (!empty($staffList)) {
  27. foreach ($staffList as $staff) {
  28. $staffId = $staff->id;
  29. $data = [
  30. 'mainId' => $mainId,
  31. 'shopId' => $shopId,
  32. 'staffId' => $staffId,
  33. 'title' => $title,
  34. 'type' => 0,
  35. 'read' => 0,
  36. 'content' => $customName . ' 申请售后',
  37. 'page' => '/pagesOrder/refundDetail?id=' . $id,
  38. ];
  39. self::add($data);
  40. }
  41. }
  42. }
  43. }