request->post(); $iv = $post['iv']; $encryptedData = $post['encryptedData']; $merchant = WxOpenService::getWxMiniBase(); $appId = $merchant['miniAppId']; $miniOpenId = $post['miniOpenId'] ?? ''; if (empty($miniOpenId)) { util::success(['hasNoOpenId' => 1], '登录失败,没有miniOpenId'); } $cacheKey = 'SHOP_MINI_SESSION_KEY_' . $miniOpenId; $sessionKey = Yii::$app->redis->executeCommand('GET', [$cacheKey]); if (empty($sessionKey)) { Yii::$app->redis->executeCommand('DEL', [$cacheKey]); //noticeUtil::push($cacheKey . " 登录失败!!sessionKey空的", '15280215347'); util::success(['hasNoOpenId' => 1], '登录失败!'); } $wxMiniSecret = Yii::getAlias("@vendor/weixinMiniSecret"); require_once($wxMiniSecret . '/wxBizDataCrypt.php'); $pc = new \WXBizDataCrypt($appId, $sessionKey); $errCode = $pc->decryptData($encryptedData, $iv, $result); if ($errCode != 0) { Yii::$app->redis->executeCommand('DEL', [$cacheKey]); //noticeUtil::push($cacheKey . " 登录失败!!!!sessionKey异常", '15280215347'); util::success(['hasNoOpenId' => 1], '登录失败...'); } $arr = Json::decode($result); $phoneNumber = isset($arr['purePhoneNumber']) ? $arr['purePhoneNumber'] : ''; if (empty($phoneNumber)) { Yii::$app->redis->executeCommand('DEL', [$cacheKey]); //noticeUtil::push($cacheKey . " 登录失败了!获取手机号失败", '15280215347'); util::success(['hasNoOpenId' => 1], '登录失败了哦'); } $admin = AdminService::getByCondition(['mobile' => $phoneNumber]); if (empty($admin)) { util::fail('请先注册'); } $adminId = $admin['id']; AdminClass::updateById($adminId, ['miniOpenId' => $miniOpenId]); $admin['miniOpenId'] = $miniOpenId; $openShop = $admin['openShop'] ?? 1; $currentShopId = $admin['currentShopId'] ?? 0; if (empty($currentShopId)) { if ($openShop == 2) { util::fail('审核中'); } util::fail('请先注册'); } $currentShop = ShopClass::getById($currentShopId, true); if (empty($currentShop)) { util::fail('没有找到门店36'); } $pfShopId = $currentShop->pfShopId ?? 0; $onlyCg = $currentShop->onlyCg ?? 1; $mainId = $currentShop->mainId ?? 0; $shareLogo = imgUtil::groupImg('buy_logo.jpg'); if (isset($currentShop->shareLogo) && !empty($currentShop->shareLogo)) { $shareLogo = imgUtil::groupImg($currentShop->shareLogo); } $shopAdmin = ShopAdminService::getByCondition(['adminId' => $adminId, 'mainId' => $mainId], true); if (empty($shopAdmin)) { util::fail('无法操作'); } if ($shopAdmin->status == 0) { util::fail("您的账号已被冻结"); } $token = jwt::getNewToken($adminId); $shopAdmin->lastLogin = date("Y-m-d H:i:s"); $shopAdmin->save(); $shopAdminId = $shopAdmin->id ?? 0; //是否有切换门店的权限 $switchShop = \biz\shop\classes\ShopAdminClass::hasSwitchShopRight($shopAdmin); $prefix = imgUtil::getPrefix(); $avatar = isset($admin['avatar']) && !empty($admin['avatar']) ? $prefix . $admin['avatar'] : $prefix . '/retail/default-img.png'; $admin['avatar'] = $avatar; $showDemo = 1; $remind = getenv('HD_UPDATE_REMIND') == false ? 0 : getenv('HD_UPDATE_REMIND'); $hdUpgrading = getenv('HD_UPGRADING') == false ? 0 : getenv('HD_UPGRADING'); if ($hdUpgrading == 1) { util::fail('系统升级中,稍后再试'); } $apiHost = Yii::$app->params['hdHost']; $imgUploadApi = $apiHost . '/upload/save-file'; //惠雅鲜花员工不能看收入情况 if (in_array($adminId, [2366, 2812, 4004])) { $shopAdmin->super = 0; } //涉及几个登录的地方,需要同步修改,请搜索关键词uni_login_info util::success([ 'token' => $token, 'admin' => $admin, 'shopId' => $currentShopId, 'shopAdminId' => $shopAdminId, 'switchShop' => $switchShop, 'pfShopId' => $pfShopId, 'onlyCg' => $onlyCg, 'shareLogo' => $shareLogo, 'showDemo' => $showDemo, 'imgUploadApi' => $imgUploadApi, //有小程序新版本提示更新 'update' => $remind, 'staff' => $shopAdmin, ]); } //app登陆 ssh 20211219 public function actionAppLogin() { $get = Yii::$app->request->get(); $mobile = isset($get['mobile']) ? $get['mobile'] : 0; if (stringUtil::isMobile($mobile) == false) { util::fail('请填写正确手机号'); } $password = isset($get['password']) && !empty($get['password']) ? $get['password'] : ''; if (empty($password)) { util::fail('请输入密码'); } $admin = AdminService::getByCondition(['mobile' => $mobile]); if (empty($admin)) { util::fail('请先注册...'); } if (password_verify($password, $admin['password']) == false) { util::fail('密码错误'); } $openShop = $admin['openShop'] ?? 1; $currentShopId = $admin['currentShopId'] ?? 0; if (empty($currentShopId)) { if ($openShop == 2) { util::fail('审核中'); } util::fail('请先注册'); } $currentShop = \bizHd\shop\classes\ShopClass::getById($currentShopId, true); if (empty($currentShop)) { util::fail('没有找到门店37'); } $mainId = $currentShop->mainId ?? 0; $pfShopId = $currentShop->pfShopId ?? 0; $onlyCg = $currentShop->onlyCg ?? 1; $shareLogo = imgUtil::groupImg('buy_logo.jpg'); if (isset($currentShop->shareLogo) && !empty($currentShop->shareLogo)) { $shareLogo = imgUtil::groupImg($currentShop->shareLogo); } $adminId = $admin['id']; $shopAdmin = ShopAdminService::getByCondition(['mainId' => $mainId, 'adminId' => $adminId], true); if (empty($shopAdmin)) { util::fail('无法操作'); } if ($shopAdmin->status == 0) { util::fail("您的账号已被冻结"); } if ($shopAdmin->delStatus == 1) { util::fail("您的账号已删除"); } $token = jwt::getNewToken($adminId); $shopAdmin->lastLogin = date("Y-m-d H:i:s"); $shopAdmin->save(); $shopAdminId = $shopAdmin->id ?? 0; //是否有切换门店的权限 $switchShop = \biz\shop\classes\ShopAdminClass::hasSwitchShopRight($shopAdmin); $prefix = imgUtil::getPrefix(); $avatar = isset($admin['avatar']) && !empty($admin['avatar']) ? $prefix . $admin['avatar'] : $prefix . '/retail/default-img.png'; $admin['avatar'] = $avatar; $showDemo = 1; $remind = getenv('HD_UPDATE_REMIND') == false ? 0 : getenv('HD_UPDATE_REMIND'); $hdUpgrading = getenv('HD_UPGRADING') == false ? 0 : getenv('HD_UPGRADING'); if ($hdUpgrading == 1) { util::fail('系统升级中,稍后再试'); } $apiHost = Yii::$app->params['hdHost']; $imgUploadApi = $apiHost . '/upload/save-file'; //惠雅鲜花员工不能看收入情况 if (in_array($adminId, [2366, 2812, 4004])) { $shopAdmin->super = 0; } //涉及几个登录的地方,需要同步修改,请搜索关键词uni_login_info util::success([ 'token' => $token, 'admin' => $admin, 'shopId' => $currentShopId, 'shopAdminId' => $shopAdminId, 'switchShop' => $switchShop, 'pfShopId' => $pfShopId, 'onlyCg' => $onlyCg, 'shareLogo' => $shareLogo, 'imgUploadApi' => $imgUploadApi, 'showDemo' => $showDemo, //有小程序新版本提示更新 'update' => $remind, 'staff' => $shopAdmin, ]); } //本机号码一键登录 ssh 20210117 public function actionPhoneLogin() { $get = Yii::$app->request->get(); $access_token = $get['access_token'] ?? ''; $openid = $get['openid'] ?? ''; if (empty($access_token) || empty($openid)) { util::fail('参数错误'); } //密钥,需要和uniCloud里的一致 $secret = 'XHB2021198819640123'; $params = ['access_token' => $access_token, 'openid' => $openid]; $stringSignTemp = ''; foreach ($params as $k => $v) { $stringSignTemp .= $k . '=' . $v . '&'; } $stringSignTemp = rtrim($stringSignTemp, '&'); $sign = hash_hmac('sha256', $stringSignTemp, $secret); $url = Yii::$app->params['hdUniCloudHost'] . "/getMobileNumber?access_token=" . $access_token . "&sign=" . $sign . "&" . $stringSignTemp; $curl = new curl\Curl(); $respond = $curl->get($url); Yii::info($respond); $result = json_decode($respond, true); if (isset($result['code']) == false || $result['code'] != 1) { util::fail('获取手机号失败'); } $phoneNumber = $result['data']['phoneNumber'] ?? ''; if (empty($phoneNumber)) { util::fail('没有获取到手机号'); } $admin = AdminService::getByCondition(['mobile' => $phoneNumber]); if (empty($admin)) { util::fail('请先注册'); } $openShop = $admin['openShop'] ?? 1; $currentShopId = $admin['currentShopId'] ?? 0; if (empty($currentShopId)) { if ($openShop == 2) { util::fail('审核中'); } util::fail('请先注册'); } $currentShop = ShopClass::getById($currentShopId, true); if (empty($currentShop)) { util::fail('登录失败,没有找到门店38'); } $pfShopId = $currentShop->pfShopId ?? 0; $onlyCg = $currentShop->onlyCg ?? 1; $shareLogo = imgUtil::groupImg('buy_logo.jpg'); if (isset($currentShop->shareLogo) && !empty($currentShop->shareLogo)) { $shareLogo = imgUtil::groupImg($currentShop->shareLogo); } $adminId = $admin['id']; $mainId = $currentShop->mainId ?? 0; $shopAdmin = ShopAdminService::getByCondition(['mainId' => $mainId, 'adminId' => $adminId], true); if (empty($shopAdmin)) { util::fail('无法操作'); } if ($shopAdmin->status == 0) { util::fail("您的账号已被冻结"); } if ($shopAdmin->delStatus == 1) { util::fail("您的账号已删除"); } $token = jwt::getNewToken($adminId); $shopAdmin->lastLogin = date("Y-m-d H:i:s"); $shopAdmin->save(); $shopAdminId = $shopAdmin->id ?? 0; //是否有切换门店的权限 $switchShop = \biz\shop\classes\ShopAdminClass::hasSwitchShopRight($shopAdmin); $prefix = imgUtil::getPrefix(); $avatar = isset($admin['avatar']) && !empty($admin['avatar']) ? $prefix . $admin['avatar'] : $prefix . '/retail/default-img.png'; $admin['avatar'] = $avatar; $showDemo = 1; $remind = getenv('HD_UPDATE_REMIND') == false ? 0 : getenv('HD_UPDATE_REMIND'); $hdUpgrading = getenv('HD_UPGRADING') == false ? 0 : getenv('HD_UPGRADING'); if ($hdUpgrading == 1) { util::fail('系统升级中,稍后再试'); } $apiHost = Yii::$app->params['hdHost']; $imgUploadApi = $apiHost . '/upload/save-file'; //惠雅鲜花员工不能看收入情况 if (in_array($adminId, [2366, 2812, 4004])) { $shopAdmin->super = 0; } //涉及几个登录的地方,需要同步修改,请搜索关键词uni_login_info util::success([ 'token' => $token, 'admin' => $admin, 'shopId' => $currentShopId, 'shopAdminId' => $shopAdminId, 'pfShopId' => $pfShopId, 'onlyCg' => $onlyCg, 'shareLogo' => $shareLogo, 'switchShop' => $switchShop, 'showDemo' => $showDemo, 'imgUploadApi' => $imgUploadApi, //有小程序新版本提示更新 'update' => $remind, 'staff' => $shopAdmin, ]); } //准备授权 ssh 2019.11.19 public function actionPrepare() { $get = Yii::$app->request->get(); $url = isset($get['url']) && !empty($get['url']) ? $get['url'] : ''; if (empty($url)) { util::fail('没有网址'); } $account = httpUtil::getAccount($url); if (empty($account)) { util::fail('没有商家帐号'); } $merchant = MerchantService::getById($account); if (empty($merchant)) { util::fail('商家无效'); } /** * authScope 参数的说明 * 1.用户通过公众号菜单打开网页,因为已经关注过了公众号,已经生成过用户信息,所以只要使用snsapi_base静默方式拿到openid就可以 * 2.为了保证付款页的访问速度,暂时只要通过snsapi_base静默方式拿到openid先生成可以用的用户信息即可 * 3.其它情况需要获取用户完整信息的,使用snsapi_userinfo让用户授权获取信息即可 * 4.snsapi_base静默方式使用的场景更多,所以参数authScope默认使用snsapi_base */ $authScope = isset($get['authScope']) ? $get['authScope'] : 'snsapi_base'; $urlEncode = stringUtil::urlSafeB64Encode($url); //微信授权获取code ssh 2019.11.24 $isOpen = 1; wxUtil::getCode($urlEncode, $merchant, $authScope, $isOpen); util::end(); } //微信授权获取用户信息 ssh 2019.11.20 public function actionGetUserInfo() { $get = Yii::$app->request->get(); $code = isset($get['code']) ? $get['code'] : ''; if (empty($code)) { util::fail('没有获取用户code'); } if (isset($get['state']) && $get['state'] == 'authdeny') { util::fail('auth fail'); } $urlEncode = $get['url']; $url = stringUtil::urlSafeBase64Decode($urlEncode); $account = httpUtil::getAccount($url); if (empty($account)) { util::stop('商店ID无效!!'); } $merchant = xhMerchantService::getByAccount($account); if (empty($merchant)) { util::stop('商店无效'); } $sjId = $merchant['id']; $authScope = isset($get['authScope']) ? $get['authScope'] : ''; if (empty($authScope)) { util::stop('没有授权类型'); } $data = wxUtil::getOpenId($code, $merchant, 1); if ($data === false) { //微信授权获取code ssh 2019.11.24 wxUtil::getCode($urlEncode, $merchant, $authScope, 1); util::end(); } $openId = $data['openid']; $access_token = $data['access_token']; $user = UserService::getByOpenId($openId); //用户来源 $userSource = Yii::$app->dict->getValue('userSourceGetId', 'official'); $source = $userSource['name']; if (empty($user)) { //$authScope 默认是 snsapi_base 公众号菜单打开网页(已经关注公众号,有完整信息)、打开付款页(有些客户只付款,没有后续可以不用登记完整信息),只需要获取openid $originalInfo = []; $originalInfo['openId'] = $openId; $originalInfo['sjId'] = $sjId; //没有关注公众号,需要获取用户完整信息的情况,则通过弹框授权 if ($authScope == 'snsapi_userinfo') { $baseInfo = wxUtil::authGetUserInfo($openId, $access_token); $originalInfo = array_merge($baseInfo, $originalInfo); $originalInfo['isFull'] = 1; $originalInfo['unionId'] = $baseInfo['unionid']; $originalInfo['headImgUrl'] = $baseInfo['headimgurl']; $originalInfo['nickName'] = $baseInfo['nickName']; } $user = UserService::replaceUser($originalInfo, $source, $sjId); } else { if ($user['isFull'] == 0) { if ($authScope == 'snsapi_userinfo') { $baseInfo = wxUtil::authGetUserInfo($openId, $access_token); $originalInfo = $baseInfo; $originalInfo['isFull'] = 1; $originalInfo['unionId'] = $baseInfo['unionid']; $originalInfo['headImgUrl'] = $baseInfo['headimgurl']; $originalInfo['openId'] = $baseInfo['openid']; $originalInfo['nickName'] = $baseInfo['nickName']; $originalInfo['sjId'] = $sjId; $user = UserService::replaceUser($originalInfo, $source, $sjId); } } } //这个的基类没有设置统一的全局变量,这里进行设置一次 $userId = $user['id']; $admin = AdminService::getByCondition(['userId' => $userId]); if (empty($admin)) { util::fail('您无法访问'); } $adminId = $admin['id']; //获取token $token = jwt::getNewToken($adminId); $url = strpos($url, '?') === false ? $url . '?token=' . $token : $url . '&token=' . $token; $this->redirect($url); } //登陆并拿到token ssh 2019.11.23 public function actionLogin() { $get = Yii::$app->request->get(); $mobile = isset($get['mobile']) ? $get['mobile'] : 0; if (stringUtil::isMobile($mobile) == false) { util::fail('请填写正常的手机号'); } $password = isset($get['password']) && !empty($get['password']) ? $get['password'] : ''; if (empty($password)) { util::fail('请输入密码'); } $admin = AdminService::getByCondition(['mobile' => $mobile]); if (empty($admin)) { util::fail('请先注册哦。'); } if (password_verify($password, $admin['password']) == false) { util::fail('密码错误'); } $adminId = $admin['id']; $openShop = $admin['openShop'] ?? 1; $currentShopId = $admin['currentShopId'] ?? 0; if (empty($currentShopId)) { if ($openShop == 2) { util::fail('审核中'); } util::fail('请先注册'); } $currentShop = ShopClass::getById($currentShopId, true); if (empty($currentShop)) { util::fail('没有找到门店39'); } $pfShopId = $currentShop->pfShopId ?? 0; if (!empty($pfShopId)) { //util::fail('批发店请不要在零售端登录'); } $sjId = $currentShop->sjId ?? 0; $mainId = $currentShop->mainId ?? 0; $shopAdmin = ShopAdminService::getByCondition(['adminId' => $adminId, 'mainId' => $mainId], true); if (empty($shopAdmin)) { util::fail('无法操作'); } if ($shopAdmin->status == 0) { util::fail("您的账号已被冻结"); } $token = jwt::getNewToken($adminId); $shopAdmin->lastLogin = date("Y-m-d H:i:s"); $shopAdmin->save(); //是否有切换门店的权限 $switchShop = \biz\shop\classes\ShopAdminClass::hasSwitchShopRight($shopAdmin); $prefix = imgUtil::getPrefix(); $avatar = isset($admin['avatar']) && !empty($admin['avatar']) ? $prefix . $admin['avatar'] : $prefix . '/retail/default-img.png'; $admin['avatar'] = $avatar; $hdUpgrading = getenv('HD_UPGRADING') == false ? 0 : getenv('HD_UPGRADING'); if ($hdUpgrading == 1) { util::fail('系统升级中,稍后再试'); } $apiHost = Yii::$app->params['hdHost']; $imgUploadApi = $apiHost . '/upload/save-file'; util::success(['token' => $token, 'account' => $sjId, 'shopId' => $currentShopId, 'imgUploadApi' => $imgUploadApi, 'switchShop' => $switchShop,]); } //静默获取小程序用户信息 public function actionMiniInfo() { //花店平台 Yii::$app->params['ptStyle'] = dict::getDict('ptStyle', 'hd'); $code = Yii::$app->request->get('code', ''); $wxMiniBase = WxOpenService::getWxMiniBase(); $appId = $wxMiniBase['miniAppId']; $appSecret = $wxMiniBase['miniAppSecret']; if (empty($appSecret)) { Yii::info('没有找到小程序的密钥'); //没有管理店铺不允许登录 util::success(['token' => '']); } $url = "https://api.weixin.qq.com/sns/jscode2session?appid={$appId}&secret={$appSecret}&js_code={$code}&grant_type=authorization_code"; $curl = new curl\Curl(); $curl->setOption(CURLOPT_SSL_VERIFYPEER, false); $result = $curl->get($url); $arr = Json::decode($result); $sessionKey = isset($arr['session_key']) ? $arr['session_key'] : ''; $openid = $arr['openid'] ?? ''; $cacheKey = 'SHOP_MINI_SESSION_KEY_' . $openid; Yii::$app->redis->executeCommand('SET', [$cacheKey, $sessionKey]); if (empty($openid)) { Yii::info(json_encode($arr)); //没有管理店铺不允许登录 util::success(['token' => '', 'currentMiniOpenId' => $openid]); } $admin = AdminService::getByCondition(['miniOpenId' => $openid]); if (empty($admin)) { //没有管理店铺不允许登录 util::success(['token' => '', 'currentMiniOpenId' => $openid]); } $adminId = $admin['id']; $currentShopId = $admin['currentShopId'] ?? 0; if (empty($currentShopId)) { //没有管理店铺不允许登录 util::success(['token' => '', 'currentMiniOpenId' => $openid]); } $currentShop = ShopClass::getById($currentShopId, true); if (empty($currentShop)) { //没有管理店铺不允许登录 util::success(['token' => '', 'currentMiniOpenId' => $openid]); } $mainId = $currentShop->mainId ?? 0; $pfShopId = $currentShop->pfShopId ?? 0; $onlyCg = $currentShop->onlyCg ?? 1; $shareLogo = imgUtil::groupImg('buy_logo.jpg'); if (isset($currentShop->shareLogo) && !empty($currentShop->shareLogo)) { $shareLogo = imgUtil::groupImg($currentShop->shareLogo); } $shopAdmin = ShopAdminClass::getByCondition(['mainId' => $mainId, 'adminId' => $adminId], true); if (empty($shopAdmin)) { //没有管理店铺不允许登录 util::success(['token' => '', 'currentMiniOpenId' => $openid]); } if (isset($shopAdmin->status) == false || $shopAdmin->status == 0) { //账号冻结不再自动登录 util::success(['token' => '', 'currentMiniOpenId' => $openid]); } $shopAdmin->lastLogin = date("Y-m-d H:i:s"); $shopAdmin->save(); $shopAdminId = $shopAdmin->id ?? 0; //是否有切换门店的权限 $switchShop = \biz\shop\classes\ShopAdminClass::hasSwitchShopRight($shopAdmin); $prefix = imgUtil::getPrefix(); $avatar = isset($admin['avatar']) && !empty($admin['avatar']) ? $prefix . $admin['avatar'] : $prefix . '/retail/default-img.png'; $admin['avatar'] = $avatar; $token = jwt::getNewToken($adminId); $showDemo = 1; $remind = getenv('HD_UPDATE_REMIND') == false ? 0 : getenv('HD_UPDATE_REMIND'); $hdUpgrading = getenv('HD_UPGRADING') == false ? 0 : getenv('HD_UPGRADING'); if ($hdUpgrading == 1) { util::fail('系统升级中,稍后再试'); } $apiHost = Yii::$app->params['hdHost']; $imgUploadApi = $apiHost . '/upload/save-file'; //惠雅鲜花员工不能看收入情况 if (in_array($adminId, [2366, 2812, 4004])) { $shopAdmin->super = 0; } //涉及几个登录的地方,需要同步修改,请搜索关键词uni_login_info util::success([ 'token' => $token, 'admin' => $admin, 'shopId' => $currentShopId, 'shopAdminId' => $shopAdminId, 'switchShop' => $switchShop, 'pfShopId' => $pfShopId, 'onlyCg' => $onlyCg, 'shareLogo' => $shareLogo, 'showDemo' => $showDemo, 'imgUploadApi' => $imgUploadApi, //有小程序新版本提示更新 'update' => $remind, 'currentMiniOpenId' => $openid, 'staff' => $shopAdmin, ]); } //获取收款码的二维码图片 ssh 20210602 public function actionGatheringImgUrl() { $id = Yii::$app->request->get('id', 0); $shop = ShopClass::getById($id, true); if (empty($shop)) { util::fail('没有找到门店40'); } $sjId = $shop->sjId; $imgUrl = ShopClass::generateGatheringCode($sjId, $id); $fileResource = file_get_contents($imgUrl); header('Content-type: image/jpeg'); echo $fileResource; } //最新版本 ssh 20220211 public function actionGetApkVersion() { $version = getenv('HD_NEW_APK_VERSION') == false ? '1.0.0' : getenv('HD_NEW_APK_VERSION'); $mustUpdate = getenv('HD_NEW_APK_VERSION_MUST_UPDATE') == false ? 0 : getenv('HD_NEW_APK_VERSION_MUST_UPDATE'); util::success(['version' => $version, 'mustUpdate' => $mustUpdate]); } //收银台apk更新 ssh 20220310 public function actionGetPadApkVersion() { $version = getenv('HD_NEW_PAD_APK_VERSION') == false ? '1.0.0' : getenv('HD_NEW_PAD_APK_VERSION'); $mustUpdate = getenv('HD_NEW_PAD_APK_VERSION_MUST_UPDATE') == false ? 0 : getenv('HD_NEW_PAD_APK_VERSION_MUST_UPDATE'); util::success(['version' => $version, 'mustUpdate' => $mustUpdate]); } }