request->get(); $isMini = $get['isMini'] ?? 0; $notice = []; $sj = isset($this->sj) && !empty($this->sj) ? $this->sj->attributes : []; $deadline = $sj['deadline'] ?? 0; $current = time(); $remain = strtotime($deadline) - $current; if ($remain <= 1296000) { //是否有充值免费续期权限 $hasRight = SjClass::hasRechargeRenewRight($sj, $this->sjExtend); if ($hasRight) { $title = '您的试用期已结束,点此免费续期'; if ($remain > 0) { $num = ceil($remain / 86400); $title = "您的试用期还有{$num}天,点此免费续期"; } } else { if ($remain > 0) { $num = ceil($remain / 86400); $title = "您的试用期还有{$num}天,请及时续费"; } } } //引导关注公众号 $admin = $this->admin; if ($isMini == 1 && !empty($admin)) { $miniOpenId = $admin['miniOpenId'] ?? ''; if (empty($miniOpenId)) { $notice = [['title' => '绑定微信,下次自动登录后台', 'action' => '去绑定', 'page' => '/admin/staff/miniAutoLogin']]; } } $todayVisit = 0; $todaySale = 0.00; $orderNum = 0; if (isset($this->shop) && !empty($this->shop)) { //今天销售 $sale = StatSaleClass::getByCondition(['mainId' => $this->mainId, 'time' => date('Ymd')]); $todaySale = $sale['amount'] ?? 0; $orderNum = $sale['num'] ?? 0; } //2021.4.14 lqh 今日支出 $outData = StatOutService::getTodayNum($this->mainId); $todayOut = $outData['amount'] ?? '0.00'; $todayData = ['visit' => $todayVisit, 'income' => $todaySale, 'order' => $orderNum, 'out' => $todayOut]; $incomeStat = []; $visitStat = [ 'month' => 1999, 'week' => 999, 'list' => ['7.1' => 100, '7.2' => 200, '7.3' => 300, '7.4' => 400, '7.5' => 500], ]; //是否已经提醒小程序名称变更 $cacheKey = 'change_mini_name_remind_' . $this->shopAdminId; $hasRemindChangeAppName = Yii::$app->redis->executeCommand('GET', [$cacheKey]); $hasRemindChange = 1; if (empty($hasRemindChangeAppName)) { if (!empty($this->shopAdminId)) { $hasRemindChange = 0; } } util::success([ 'asset' => $this->main, 'notice' => $notice, 'todayData' => $todayData, 'visitStat' => $visitStat, 'incomeStat' => $incomeStat, 'hasRemindChangeAppName' => $hasRemindChange, ]); } //常用初始化 public function actionInit() { $dict = dict::get(); $shop = isset($this->shop) && !empty($this->shop) ? $this->shop->attributes : []; util::success(['dict' => $dict, 'shop' => $shop]); } }