post('app_sources', 'ios'); $cacheKey = "caches:config:app_{$appSources}"; $config = RedisService::get($cacheKey); if (empty($config)) { $config = [ 'app_name' => ConfigService::make()->getConfigByCode('app_name'), 'app_logo' => get_image_url(ConfigService::make()->getConfigByCode('app_logo')), 'app_version' => ConfigService::make()->getConfigByCode('app_version'), 'app_android_url' => ConfigService::make()->getConfigByCode('app_android_url'), 'deposit_money' => ConfigService::make()->getConfigByCode('deposit_money'), 'deposit_desc' => format_content(ConfigService::make()->getConfigByCode('deposit_desc', '')), 'deposit_refund_desc' => format_content(ConfigService::make()->getConfigByCode('deposit_refund_desc', '')), 'alipay_open' => ConfigService::make()->getConfigByCode('alipay_open', 1), 'wxpay_open' => ConfigService::make()->getConfigByCode('wxpay_open', 1), 'withdraw_open' => ConfigService::make()->getConfigByCode('withdraw_open', 1), 'withdraw_min' => ConfigService::make()->getConfigByCode('withdraw_min', 0), 'withdraw_fee' => ConfigService::make()->getConfigByCode('withdraw_fee', 0), 'kfUrl' => ConfigService::make()->getConfigByCode('wechat_kf_url', ''), 'img_compress'=> ConfigService::make()->getConfigByCode('preview_img_compress', ''), 'notices' => [ ['id' => 1, 'title' => '平台上线', 'url' => ''], ['id' => 2, 'title' => '这里是一段滚动资讯这里是一段滚动资讯..', 'url' => ''] ], ]; RedisService::set($cacheKey, $config, 3600); } return showJson(1010, true, $config); } catch (\Exception $exception) { RedisService::set("caches:request:error_config", ['trace' => $exception->getTrace()], 7200); return showJson(1018, false, ['error' => env('APP_DEBUG') ? $exception->getMessage() : '']); } } /** * 首页数据 * @return array */ public function data() { $userInfo = MemberService::make()->getInfo($this->userId,[], true); $confirmStatus = isset($userInfo['confirm_status'])? $userInfo['confirm_status'] : 0; $pickerStatus = isset($userInfo['picker_status'])? $userInfo['picker_status'] : 0; if($confirmStatus != 1 || $pickerStatus!= 1){ return message(2043, false,[],405); } $data = [ // 首页数据 'counts' => [ 'dayIncome' => AccountService::make()->getTotalByDay($this->userId, 1), 'dayOrder' => OrderService::make()->getCountByDay($this->userId, 3), ], ]; return showJson(1010, true, $data); } /** * 验证更新 * @return array */ public function versionCheck() { $version = request()->post('version', ''); $appSources = request()->post('app_sources', 'ios'); $currentVersion = ConfigService::make()->getConfigByCode('app_version'); if (getVersion($version) < getVersion($currentVersion)) { $data = [ 'has_update' => true, 'app_version' => $currentVersion, 'app_name' => ConfigService::make()->getConfigByCode('app_name'), 'app_url' => ConfigService::make()->getConfigByCode("app_{$appSources}_url"), 'is_force' => ConfigService::make()->getConfigByCode("app_force_update"), 'auto_update' => false, // 是否APP内自动更新 ]; return showJson(1010, true, $data); } else { return showJson(1010, false, ['has_update' => false, 'version' => $version]); } } }