mainId ?? 0; $shopId = $shop->id ?? 0; $id = $bookItemCustomRes->id ?? 0; $customName = $bookItemCustomRes->customName ?? ''; $seatSn = $bookItemCustomRes->seatSn ?? 0; $itemName = $bookItemCustomRes->name ?? ''; $itemId = $bookItemCustomRes->itemId ?? 0; $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' => '下架花材', 'type' => 2, 'targetId' => $id, 'read' => 0, 'content' => '预订减少,请下架' . $customName . '(' . $seatSn . ')' . $itemName . $num . '份', 'page' => '/admin/book/itemCustom?itemId=' . $itemId . '&itemName=' . $itemName, ]; self::add($data); $notifyNum = bcadd($staff->notifyNum, 1); $staff->notifyNum = $notifyNum; $staff->save(); } } $noticeText = json_encode(['id' => $id, 'num' => $num, 'shopId' => $shopId]); $noticeKey = "bookChangeOffItem"; Yii::$app->redis->executeCommand('LPUSH', [$noticeKey, $noticeText]); } //新增售后申请通过 ssh 20230814 public static function addRefundApplyNotify($refund) { $mainId = $refund->mainId ?? 0; $shopId = $refund->shopId ?? 0; $title = '售后申请'; $id = $refund->id; $refundPrice = $refund->refundPrice; $refundPrice = floatval($refundPrice); $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, 'targetId' => $id, 'read' => 0, 'content' => $customName . '申请退款' . $refundPrice . '元', 'page' => '/pagesOrder/refundDetail?from=1&id=' . $id, ]; self::add($data); $notifyNum = bcadd($staff->notifyNum, 1); $staff->notifyNum = $notifyNum; $staff->save(); } } } }