AuthController.php 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515
  1. <?php
  2. namespace hd\controllers;
  3. use biz\admin\classes\AdminClass;
  4. use biz\shop\classes\ShopClass;
  5. use bizHd\admin\classes\ShopAdminClass;
  6. use bizHd\admin\services\ShopAdminService;
  7. use bizHd\admin\services\AdminService;
  8. use bizHd\user\classes\UserClass;
  9. use bizHd\wx\services\WxOpenService;
  10. use common\components\dict;
  11. use common\components\httpUtil;
  12. use common\components\imgUtil;
  13. use common\components\jwt;
  14. use common\components\util;
  15. use Yii;
  16. use common\components\stringUtil;
  17. use biz\sj\services\MerchantService;
  18. use bizHd\user\services\UserService;
  19. use common\services\xhMerchantService;
  20. use common\components\wxUtil;
  21. use linslin\yii2\curl;
  22. use yii\helpers\Json;
  23. /**
  24. * 用户登陆
  25. */
  26. class AuthController extends PublicController
  27. {
  28. //微信手机号一键登录 shish 20210121
  29. public function actionWxMobileLogin()
  30. {
  31. $post = Yii::$app->request->post();
  32. $iv = $post['iv'];
  33. $encryptedData = $post['encryptedData'];
  34. $merchant = WxOpenService::getWxMiniBase();
  35. $appId = $merchant['miniAppId'];
  36. $miniOpenId = $post['miniOpenId'] ?? '';
  37. if (empty($miniOpenId)) {
  38. util::fail('登录失败...');
  39. }
  40. $cacheKey = 'SHOP_MINI_SESSION_KEY_' . $miniOpenId;
  41. $sessionKey = Yii::$app->redis->executeCommand('GET', [$cacheKey]);
  42. if (empty($sessionKey)) {
  43. util::fail('登录失败了哦');
  44. }
  45. $wxMiniSecret = Yii::getAlias("@vendor/weixinMiniSecret");
  46. require_once($wxMiniSecret . '/wxBizDataCrypt.php');
  47. $pc = new \WXBizDataCrypt($appId, $sessionKey);
  48. $errCode = $pc->decryptData($encryptedData, $iv, $result);
  49. if ($errCode != 0) {
  50. util::fail('登录失败..');
  51. }
  52. $arr = Json::decode($result);
  53. $phoneNumber = isset($arr['purePhoneNumber']) ? $arr['purePhoneNumber'] : '';
  54. if (empty($phoneNumber)) {
  55. util::fail('登录失败了');
  56. }
  57. $admin = AdminService::getByCondition(['mobile' => $phoneNumber, 'style' => AdminClass::STYLE_HD]);
  58. if (empty($admin)) {
  59. util::fail('请先注册');
  60. }
  61. $openShop = $admin['openShop'] ?? 1;
  62. $currentShopId = $admin['currentShopId'] ?? 0;
  63. if (empty($currentShopId)) {
  64. if ($openShop == 2) {
  65. util::fail('审核中');
  66. }
  67. util::fail('请先注册');
  68. }
  69. $adminId = $admin['id'];
  70. $shopAdmin = ShopAdminService::getByCondition(['adminId' => $adminId, 'shopId' => $currentShopId, 'delStatus' => 0], true);
  71. if (empty($shopAdmin)) {
  72. util::fail('没有权限操作');
  73. }
  74. if ($shopAdmin->status == 0) {
  75. util::fail("您的账号已冻结");
  76. }
  77. $shopId = $shopAdmin->shopId ?? 0;
  78. if (empty($shopId)) {
  79. util::fail('您不是管理员');
  80. }
  81. $token = jwt::getNewToken($adminId);
  82. $shopAdmin->lastLogin = date("Y-m-d H:i:s");
  83. $shopAdmin->save();
  84. $shopAdminId = $shopAdmin->id ?? 0;
  85. //是否有切换门店的权限
  86. $switchShop = \biz\shop\classes\ShopAdminClass::hasSwitchShopRight($shopAdmin->attributes);
  87. $prefix = imgUtil::getPrefix();
  88. $avatar = isset($admin['avatar']) && !empty($admin['avatar']) ? $prefix . $admin['avatar'] : $prefix . '/retail/default-img.png';
  89. $admin['avatar'] = $avatar;
  90. $showDemo = 1;
  91. $remind = getenv('HD_UPDATE_REMIND') == false ? 0 : getenv('HD_UPDATE_REMIND');
  92. $hdUpgrading = getenv('HD_UPGRADING') == false ? 0 : getenv('HD_UPGRADING');
  93. if ($hdUpgrading == 1) {
  94. util::fail('系统升级中,稍后再试');
  95. }
  96. //涉及几个登录的地方,需要同步修改,请搜索关键词uni_login_info
  97. util::success([
  98. 'token' => $token,
  99. 'admin' => $admin,
  100. 'shopId' => $currentShopId,
  101. 'shopAdminId' => $shopAdminId,
  102. 'switchShop' => $switchShop,
  103. 'showDemo' => $showDemo,
  104. //有小程序新版本提示更新
  105. 'update' => $remind,
  106. ]);
  107. }
  108. //app登陆 shish 20211219
  109. public function actionAppLogin()
  110. {
  111. $get = Yii::$app->request->get();
  112. $mobile = isset($get['mobile']) ? $get['mobile'] : 0;
  113. if (stringUtil::isMobile($mobile) == false) {
  114. util::fail('请填写正确手机号');
  115. }
  116. $password = isset($get['password']) && !empty($get['password']) ? $get['password'] : '';
  117. if (empty($password)) {
  118. util::fail('请输入密码');
  119. }
  120. $admin = AdminService::getByCondition(['mobile' => $mobile, 'style' => AdminClass::STYLE_HD]);
  121. if (password_verify($password, $admin['password']) == false) {
  122. util::fail('密码错误');
  123. }
  124. $openShop = $admin['openShop'] ?? 1;
  125. $currentShopId = $admin['currentShopId'] ?? 0;
  126. if (empty($currentShopId)) {
  127. if ($openShop == 2) {
  128. util::fail('审核中');
  129. }
  130. util::fail('请先注册');
  131. }
  132. $adminId = $admin['id'];
  133. $shopAdmin = ShopAdminService::getByCondition(['adminId' => $adminId, 'shopId' => $currentShopId, 'delStatus' => 0], true);
  134. if (empty($shopAdmin)) {
  135. util::fail('没有权限操作');
  136. }
  137. if ($shopAdmin->status == 0) {
  138. util::fail("您的账号已冻结");
  139. }
  140. $shopId = $shopAdmin->shopId ?? 0;
  141. if (empty($shopId)) {
  142. util::fail('您不是管理员');
  143. }
  144. $token = jwt::getNewToken($adminId);
  145. $shopAdmin->lastLogin = date("Y-m-d H:i:s");
  146. $shopAdmin->save();
  147. $shopAdminId = $shopAdmin->id ?? 0;
  148. //是否有切换门店的权限
  149. $switchShop = \biz\shop\classes\ShopAdminClass::hasSwitchShopRight($shopAdmin->attributes);
  150. $prefix = imgUtil::getPrefix();
  151. $avatar = isset($admin['avatar']) && !empty($admin['avatar']) ? $prefix . $admin['avatar'] : $prefix . '/retail/default-img.png';
  152. $admin['avatar'] = $avatar;
  153. $showDemo = 1;
  154. $remind = getenv('HD_UPDATE_REMIND') == false ? 0 : getenv('HD_UPDATE_REMIND');
  155. $hdUpgrading = getenv('HD_UPGRADING') == false ? 0 : getenv('HD_UPGRADING');
  156. if ($hdUpgrading == 1) {
  157. util::fail('系统升级中,稍后再试');
  158. }
  159. //涉及几个登录的地方,需要同步修改,请搜索关键词uni_login_info
  160. util::success([
  161. 'token' => $token,
  162. 'admin' => $admin,
  163. 'shopId' => $currentShopId,
  164. 'shopAdminId' => $shopAdminId,
  165. 'switchShop' => $switchShop,
  166. 'showDemo' => $showDemo,
  167. //有小程序新版本提示更新
  168. 'update' => $remind,
  169. ]);
  170. }
  171. //本机号码一键登录 shish 20210117
  172. public function actionPhoneLogin()
  173. {
  174. $get = Yii::$app->request->get();
  175. $access_token = $get['access_token'] ?? '';
  176. $openid = $get['openid'] ?? '';
  177. if (empty($access_token) || empty($openid)) {
  178. util::fail('参数错误');
  179. }
  180. //密钥,需要和uniCloud里的一致
  181. $secret = 'XHB2021198819640123';
  182. $params = ['access_token' => $access_token, 'openid' => $openid];
  183. $stringSignTemp = '';
  184. foreach ($params as $k => $v) {
  185. $stringSignTemp .= $k . '=' . $v . '&';
  186. }
  187. $stringSignTemp = rtrim($stringSignTemp, '&');
  188. $sign = hash_hmac('sha256', $stringSignTemp, $secret);
  189. $url = Yii::$app->params['hdUniCloudHost'] . "/getMobileNumber?access_token=" . $access_token . "&sign=" . $sign . "&" . $stringSignTemp;
  190. $curl = new curl\Curl();
  191. $respond = $curl->get($url);
  192. Yii::info($respond);
  193. $result = json_decode($respond, true);
  194. if (isset($result['code']) == false || $result['code'] != 1) {
  195. util::fail('获取手机号失败');
  196. }
  197. $phoneNumber = $result['data']['phoneNumber'] ?? '';
  198. if (empty($phoneNumber)) {
  199. util::fail('没有获取到手机号');
  200. }
  201. $admin = AdminService::getByCondition(['mobile' => $phoneNumber, 'style' => AdminClass::STYLE_HD]);
  202. if (empty($admin)) {
  203. util::fail('请先注册');
  204. }
  205. $openShop = $admin['openShop'] ?? 1;
  206. $currentShopId = $admin['currentShopId'] ?? 0;
  207. if (empty($currentShopId)) {
  208. if ($openShop == 2) {
  209. util::fail('审核中');
  210. }
  211. util::fail('请先注册');
  212. }
  213. $adminId = $admin['id'];
  214. $shopAdmin = ShopAdminService::getByCondition(['adminId' => $adminId, 'shopId' => $currentShopId, 'delStatus' => 0], true);
  215. if (empty($shopAdmin)) {
  216. util::fail('没有权限操作');
  217. }
  218. if ($shopAdmin->status == 0) {
  219. util::fail("您的账号已冻结");
  220. }
  221. $shopId = $shopAdmin->shopId ?? 0;
  222. if (empty($shopId)) {
  223. util::fail('您不是管理员');
  224. }
  225. $token = jwt::getNewToken($adminId);
  226. $shopAdmin->lastLogin = date("Y-m-d H:i:s");
  227. $shopAdmin->save();
  228. $shopAdminId = $shopAdmin->id ?? 0;
  229. //是否有切换门店的权限
  230. $switchShop = \biz\shop\classes\ShopAdminClass::hasSwitchShopRight($shopAdmin->attributes);
  231. $prefix = imgUtil::getPrefix();
  232. $avatar = isset($admin['avatar']) && !empty($admin['avatar']) ? $prefix . $admin['avatar'] : $prefix . '/retail/default-img.png';
  233. $admin['avatar'] = $avatar;
  234. $showDemo = 1;
  235. $remind = getenv('HD_UPDATE_REMIND') == false ? 0 : getenv('HD_UPDATE_REMIND');
  236. $hdUpgrading = getenv('HD_UPGRADING') == false ? 0 : getenv('HD_UPGRADING');
  237. if ($hdUpgrading == 1) {
  238. util::fail('系统升级中,稍后再试');
  239. }
  240. //涉及几个登录的地方,需要同步修改,请搜索关键词uni_login_info
  241. util::success([
  242. 'token' => $token,
  243. 'admin' => $admin,
  244. 'shopId' => $currentShopId,
  245. 'shopAdminId' => $shopAdminId,
  246. 'switchShop' => $switchShop,
  247. 'showDemo' => $showDemo,
  248. //有小程序新版本提示更新
  249. 'update' => $remind,
  250. ]);
  251. }
  252. //准备授权 ssh 2019.11.19
  253. public function actionPrepare()
  254. {
  255. $get = Yii::$app->request->get();
  256. $url = isset($get['url']) && !empty($get['url']) ? $get['url'] : '';
  257. if (empty($url)) {
  258. util::fail('没有网址');
  259. }
  260. $account = httpUtil::getAccount($url);
  261. if (empty($account)) {
  262. util::fail('没有商家帐号');
  263. }
  264. $merchant = MerchantService::getById($account);
  265. if (empty($merchant)) {
  266. util::fail('商家无效');
  267. }
  268. /**
  269. * authScope 参数的说明
  270. * 1.用户通过公众号菜单打开网页,因为已经关注过了公众号,已经生成过用户信息,所以只要使用snsapi_base静默方式拿到openid就可以
  271. * 2.为了保证付款页的访问速度,暂时只要通过snsapi_base静默方式拿到openid先生成可以用的用户信息即可
  272. * 3.其它情况需要获取用户完整信息的,使用snsapi_userinfo让用户授权获取信息即可
  273. * 4.snsapi_base静默方式使用的场景更多,所以参数authScope默认使用snsapi_base
  274. */
  275. $authScope = isset($get['authScope']) ? $get['authScope'] : 'snsapi_base';
  276. $urlEncode = stringUtil::urlSafeB64Encode($url);
  277. //微信授权获取code ssh 2019.11.24
  278. $isOpen = 1;
  279. wxUtil::getCode($urlEncode, $merchant, $authScope, $isOpen);
  280. util::end();
  281. }
  282. //微信授权获取用户信息 ssh 2019.11.20
  283. public function actionGetUserInfo()
  284. {
  285. $get = Yii::$app->request->get();
  286. $code = isset($get['code']) ? $get['code'] : '';
  287. if (empty($code)) {
  288. util::fail('没有获取用户code');
  289. }
  290. if (isset($get['state']) && $get['state'] == 'authdeny') {
  291. util::fail('auth fail');
  292. }
  293. $urlEncode = $get['url'];
  294. $url = stringUtil::urlSafeBase64Decode($urlEncode);
  295. $account = httpUtil::getAccount($url);
  296. if (empty($account)) {
  297. util::stop('商店ID无效!!');
  298. }
  299. $merchant = xhMerchantService::getByAccount($account);
  300. if (empty($merchant)) {
  301. util::stop('商店无效');
  302. }
  303. $sjId = $merchant['id'];
  304. $authScope = isset($get['authScope']) ? $get['authScope'] : '';
  305. if (empty($authScope)) {
  306. util::stop('没有授权类型');
  307. }
  308. $data = wxUtil::getOpenId($code, $merchant, 1);
  309. if ($data === false) {
  310. //微信授权获取code ssh 2019.11.24
  311. wxUtil::getCode($urlEncode, $merchant, $authScope, 1);
  312. util::end();
  313. }
  314. $openId = $data['openid'];
  315. $access_token = $data['access_token'];
  316. $user = UserService::getByOpenId($openId);
  317. //用户来源
  318. $userSource = Yii::$app->dict->getValue('userSourceGetId', 'official');
  319. $source = $userSource['name'];
  320. if (empty($user)) {
  321. //$authScope 默认是 snsapi_base 公众号菜单打开网页(已经关注公众号,有完整信息)、打开付款页(有些客户只付款,没有后续可以不用登记完整信息),只需要获取openid
  322. $originalInfo = [];
  323. $originalInfo['openId'] = $openId;
  324. $originalInfo['sjId'] = $sjId;
  325. //没有关注公众号,需要获取用户完整信息的情况,则通过弹框授权
  326. if ($authScope == 'snsapi_userinfo') {
  327. $baseInfo = wxUtil::authGetUserInfo($openId, $access_token);
  328. $originalInfo = array_merge($baseInfo, $originalInfo);
  329. $originalInfo['isFull'] = 1;
  330. $originalInfo['unionId'] = $baseInfo['unionid'];
  331. $originalInfo['headImgUrl'] = $baseInfo['headimgurl'];
  332. $originalInfo['nickName'] = $baseInfo['nickName'];
  333. }
  334. $user = UserService::replaceUser($originalInfo, $source, $sjId);
  335. } else {
  336. if ($user['isFull'] == 0) {
  337. if ($authScope == 'snsapi_userinfo') {
  338. $baseInfo = wxUtil::authGetUserInfo($openId, $access_token);
  339. $originalInfo = $baseInfo;
  340. $originalInfo['isFull'] = 1;
  341. $originalInfo['unionId'] = $baseInfo['unionid'];
  342. $originalInfo['headImgUrl'] = $baseInfo['headimgurl'];
  343. $originalInfo['openId'] = $baseInfo['openid'];
  344. $originalInfo['nickName'] = $baseInfo['nickName'];
  345. $originalInfo['sjId'] = $sjId;
  346. $user = UserService::replaceUser($originalInfo, $source, $sjId);
  347. }
  348. }
  349. }
  350. //这个的基类没有设置统一的全局变量,这里进行设置一次
  351. $userId = $user['id'];
  352. $admin = AdminService::getByCondition(['userId' => $userId]);
  353. if (empty($admin)) {
  354. util::fail('您没有权限访问');
  355. }
  356. $adminId = $admin['id'];
  357. //获取token
  358. $token = jwt::getNewToken($adminId);
  359. $url = strpos($url, '?') === false ? $url . '?token=' . $token : $url . '&token=' . $token;
  360. $this->redirect($url);
  361. }
  362. //登陆并拿到token ssh 2019.11.23
  363. public function actionLogin()
  364. {
  365. $get = Yii::$app->request->get();
  366. $mobile = isset($get['mobile']) ? $get['mobile'] : 0;
  367. if (stringUtil::isMobile($mobile) == false) {
  368. util::fail('请填写正常的手机号');
  369. }
  370. $password = isset($get['password']) && !empty($get['password']) ? $get['password'] : '';
  371. if (empty($password)) {
  372. util::fail('请输入密码');
  373. }
  374. $admin = AdminService::getByCondition(['mobile' => $mobile, 'style' => AdminClass::STYLE_HD]);
  375. if (password_verify($password, $admin['password']) == false) {
  376. util::fail('密码错误');
  377. }
  378. $adminId = $admin['id'];
  379. $shopAdmin = ShopAdminService::getByCondition(['adminId' => $adminId, 'delStatus' => 0]);
  380. $sjId = isset($shopAdmin['sjId']) ? $shopAdmin['sjId'] : 0;
  381. $shopId = $shopAdmin['shopId'] ?? 0;
  382. if (empty($shopId)) {
  383. util::fail('您不是管理员');
  384. }
  385. //获取token
  386. $token = jwt::getNewToken($adminId);
  387. util::success(['token' => $token, 'account' => $sjId, 'shopId' => $shopId]);
  388. }
  389. //静默获取小程序用户信息
  390. public function actionMiniInfo()
  391. {
  392. //花店平台
  393. Yii::$app->params['ptStyle'] = dict::getDict('ptStyle', 'hd');
  394. $code = Yii::$app->request->get('code', '');
  395. $wxMiniBase = WxOpenService::getWxMiniBase();
  396. $appId = $wxMiniBase['miniAppId'];
  397. $appSecret = $wxMiniBase['miniAppSecret'];
  398. if (empty($appSecret)) {
  399. Yii::info('没有找到小程序的密钥');
  400. //没有管理店铺不允许登录
  401. util::success(['token' => '']);
  402. }
  403. $url = "https://api.weixin.qq.com/sns/jscode2session?appid={$appId}&secret={$appSecret}&js_code={$code}&grant_type=authorization_code";
  404. $curl = new curl\Curl();
  405. $curl->setOption(CURLOPT_SSL_VERIFYPEER, false);
  406. $result = $curl->get($url);
  407. $arr = Json::decode($result);
  408. $sessionKey = isset($arr['session_key']) ? $arr['session_key'] : '';
  409. $openid = $arr['openid'] ?? '';
  410. $cacheKey = 'SHOP_MINI_SESSION_KEY_' . $openid;
  411. Yii::$app->redis->executeCommand('SET', [$cacheKey, $sessionKey]);
  412. if (empty($openid)) {
  413. Yii::info(json_encode($arr));
  414. //没有管理店铺不允许登录
  415. util::success(['token' => '', 'currentMiniOpenId' => $openid]);
  416. }
  417. $admin = AdminService::getByMiniOpenId($openid);
  418. if (empty($admin)) {
  419. //没有管理店铺不允许登录
  420. util::success(['token' => '', 'currentMiniOpenId' => $openid]);
  421. }
  422. $adminId = $admin['id'];
  423. $currentShopId = $admin['currentShopId'] ?? 0;
  424. if (empty($currentShopId)) {
  425. //没有管理店铺不允许登录
  426. util::success(['token' => '', 'currentMiniOpenId' => $openid]);
  427. }
  428. $shopAdmin = ShopAdminClass::getByCondition(['shopId' => $currentShopId, 'adminId' => $adminId], true);
  429. if (empty($shopAdmin)) {
  430. //没有管理店铺不允许登录
  431. util::success(['token' => '', 'currentMiniOpenId' => $openid]);
  432. }
  433. if (isset($shopAdmin->status) == false || $shopAdmin->status == 0) {
  434. //账号冻结不再自动登录
  435. util::success(['token' => '', 'currentMiniOpenId' => $openid]);
  436. }
  437. $shopAdmin->lastLogin = date("Y-m-d H:i:s");
  438. $shopAdmin->save();
  439. $shopAdminId = $shopAdmin->id ?? 0;
  440. //是否有切换门店的权限
  441. $switchShop = \biz\shop\classes\ShopAdminClass::hasSwitchShopRight($shopAdmin->attributes);
  442. $prefix = imgUtil::getPrefix();
  443. $avatar = isset($admin['avatar']) && !empty($admin['avatar']) ? $prefix . $admin['avatar'] : $prefix . '/retail/default-img.png';
  444. $admin['avatar'] = $avatar;
  445. $token = jwt::getNewToken($adminId);
  446. $showDemo = 1;
  447. $remind = getenv('HD_UPDATE_REMIND') == false ? 0 : getenv('HD_UPDATE_REMIND');
  448. $hdUpgrading = getenv('HD_UPGRADING') == false ? 0 : getenv('HD_UPGRADING');
  449. if ($hdUpgrading == 1) {
  450. util::fail('系统升级中,稍后再试');
  451. }
  452. //涉及几个登录的地方,需要同步修改,请搜索关键词uni_login_info
  453. util::success([
  454. 'token' => $token,
  455. 'admin' => $admin,
  456. 'shopId' => $currentShopId,
  457. 'shopAdminId' => $shopAdminId,
  458. 'switchShop' => $switchShop,
  459. 'showDemo' => $showDemo,
  460. //有小程序新版本提示更新
  461. 'update' => $remind,
  462. ]);
  463. }
  464. //获取收款码的二维码图片 shish 20210602
  465. public function actionGatheringImgUrl()
  466. {
  467. $id = Yii::$app->request->get('id', 0);
  468. $shop = ShopClass::getById($id, true);
  469. if (empty($shop)) {
  470. util::fail('没有找到门店');
  471. }
  472. $sjId = $shop->sjId;
  473. $imgUrl = ShopClass::generateGatheringCode($sjId, $id);
  474. $fileResource = file_get_contents($imgUrl);
  475. header('Content-type: image/jpeg');
  476. echo $fileResource;
  477. }
  478. //最新版本 shish 20220211
  479. public function actionGetApkVersion()
  480. {
  481. $version = getenv('HD_NEW_APK_VERSION') == false ? '1.0.0' : getenv('HD_NEW_APK_VERSION');
  482. $mustUpdate = getenv('HD_NEW_APK_VERSION_MUST_UPDATE') == false ? 0 : getenv('HD_NEW_APK_VERSION_MUST_UPDATE');
  483. util::success(['version' => $version, 'mustUpdate' => $mustUpdate]);
  484. }
  485. //收银台apk更新 shish 20220310
  486. public function actionGetPadApkVersion()
  487. {
  488. $version = getenv('HD_NEW_PAD_APK_VERSION') == false ? '1.0.0' : getenv('HD_NEW_PAD_APK_VERSION');
  489. $mustUpdate = getenv('HD_NEW_PAD_APK_VERSION_MUST_UPDATE') == false ? 0 : getenv('HD_NEW_PAD_APK_VERSION_MUST_UPDATE');
  490. util::success(['version' => $version, 'mustUpdate' => $mustUpdate]);
  491. }
  492. }