| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <?php
- namespace bizGhs\notify\classes;
- use bizGhs\base\classes\BaseClass;
- use bizGhs\custom\classes\CustomClass;
- use bizGhs\shop\classes\ShopAdminClass;
- use Yii;
- class NotifyClass extends BaseClass
- {
- public static $baseFile = '\bizGhs\notify\models\Notify';
- public static function getNotifyList($where)
- {
- $data = self::getList('*', $where, 'addTime DESC');
- return $data;
- }
- //新增售后申请通过 ssh 20230814
- public static function addRefundApplyNotify($refund)
- {
- $mainId = $refund->mainId ?? 0;
- $shopId = $refund->shopId ?? 0;
- $title = '有新的售后申请';
- $id = $refund->id;
- $customId = $refund->customId;
- $custom = CustomClass::getById($customId, true);
- $customName = $custom->name ?? '';
- $staffList = ShopAdminClass::getAllByCondition(['mainId' => $mainId], null, '*', null, true);
- if (!empty($staffList)) {
- foreach ($staffList as $staff) {
- $staffId = $staff->id;
- $data = [
- 'mainId' => $mainId,
- 'shopId' => $shopId,
- 'staffId' => $staffId,
- 'title' => $title,
- 'type' => 0,
- 'read' => 0,
- 'content' => $customName . ' 申请售后',
- 'page' => '/pagesOrder/refundDetail?id=' . $id,
- ];
- self::add($data);
- }
- }
- }
- }
|