ShopProc.php 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609
  1. <?php
  2. /*
  3. * To change this license header, choose License Headers in Project Properties.
  4. * To change this template file, choose Tools | Templates
  5. * and open the template in the editor.
  6. */
  7. namespace loyalsoft;
  8. /**
  9. * Description of ShopProc
  10. *
  11. * @author c'y'zhao
  12. */
  13. class ShopProc {
  14. /**
  15. * 逻辑分发
  16. * 所有的Proc中必须有这样一个方法
  17. * @param Req $req
  18. */
  19. public static function procMain($req) {
  20. switch ($req->cmd) {
  21. case CmdCode::cmd_shop_BuyGift: # 6501 商城购买东西
  22. return ShopProc::ShopBuyGift();
  23. case CmdCode::cmd_shop_BuyTili: # 6502 买体力
  24. return ShopProc::BuyTili();
  25. default:
  26. Err(ErrCode::cmd_err);
  27. }
  28. }
  29. public static function BuyTili() {
  30. list($type) = req()->paras;
  31. $addTili = 0;
  32. if ($type == 1) {//广告
  33. $maxNum = glc()->GuanggaoGetTili_DailyMaxNum;
  34. my_Assert(ctx()->privateState->guanggaoGetTiliNum < $maxNum, ErrCode::user_shop_GuanggaoGetTiliNumLimit);
  35. my_Assert(now() - ctx()->privateState->guanggaoGetTili_ts > 300, ErrCode::user_shop_DownTsLimit);
  36. $addTili = glc()->GuanggaoGetTili;
  37. ctx()->baseInfo->Add_tili(glc()->GuanggaoGetTili);
  38. ctx()->privateState->guanggaoGetTiliNum += 1;
  39. ctx()->privateState->guanggaoGetTili_ts = now();
  40. } else {
  41. $maxNum = glc()->BuyTili_DailyMaxNum;
  42. my_Assert(ctx()->privateState->buyTiliNum < $maxNum, ErrCode::user_shop_buyTiliNumLimit);
  43. $arr = explode(',', glc()->BuyTiliCost);
  44. my_Assert(ctx()->baseInfo->cash >= $arr[0], ErrCode::user_shop_NotRepeatBuy);
  45. ctx()->baseInfo->Consume_Cash($arr[0]);
  46. $addTili = $arr[1];
  47. ctx()->baseInfo->Add_tili($arr[1]);
  48. ctx()->privateState->buyTiliNum += 1;
  49. }
  50. TaskProc::OnBuyTiliOrLookGuanggao();
  51. UserProc::updateUserInfo();
  52. return Resp::ok(array(
  53. "privateState" => ctx()->privateState,
  54. "baseInfo" => ctx()->baseInfo,
  55. "tili" => $addTili,
  56. "task" => ctx()->task,
  57. ));
  58. }
  59. /**
  60. * 商城购买东西
  61. * @return type
  62. */
  63. public static function ShopBuyGift() {
  64. list($type, $typeId, $buyNum) = req()->paras;
  65. $user = ctx();
  66. $resultArr = array();
  67. $dailyArr = array();
  68. $equip = array();
  69. $gateGift = array();
  70. switch ($type) {
  71. case EnumShopGift::GateGift_Shop://章节礼包
  72. my_Assert(!in_array($typeId, ctx()->privateState->gateGiftReceived), ErrCode::user_shop_NotRepeatBuy);
  73. $mo = GameConfig::shop_gategift_getItem($typeId);
  74. my_Assert($mo != null, ErrCode::err_const_no);
  75. $price = explode(';', $mo->reward);
  76. foreach ($price as $value) {
  77. $item = explode(',', $value);
  78. if (GameConfig::item_getItem($item[0])->itemType == EnumItemType::tuzhiBox) {
  79. $dic = GameConfig::item();
  80. $list = array();
  81. foreach ($dic as $id => $val) {
  82. if ($val->itemType == EnumItemType::tuzhi) {
  83. $list[] = $val->typeId;
  84. }
  85. }
  86. $randNum = rand(0, count($list) - 1);
  87. $tuzhiId = $list[$randNum];
  88. $gateGift[] = $tuzhiId . ',1';
  89. } else {
  90. $gateGift[] = $value;
  91. }
  92. }
  93. foreach ($gateGift as $str) {
  94. StoreProc::AddMultiItemInStore($str);
  95. }
  96. ctx()->privateState->gateGiftReceived[] = $typeId;
  97. ctx()->baseInfo->charge_amt += $mo->curPrice;
  98. break;
  99. case EnumShopGift::Daily_Shop://每日商店
  100. $mo = GameConfig::shop_daily_getItem($typeId);
  101. my_Assert($mo != null, ErrCode::err_const_no);
  102. my_Assert(in_array($typeId, $user->privateState->dailyShopRandItems), ErrCode::err_const_no);
  103. if ($mo->type == 1) {
  104. $getNum = 0;
  105. foreach ($user->privateState->dailyShopReceived as $id) {
  106. if ($id == $typeId) {
  107. $getNum += 1;
  108. }
  109. }
  110. if ($getNum >= $mo->freeNum) {
  111. my_Assert($user->privateState->dailyShop_GuangGaoNum < $mo->num, ErrCode::user_shop_GuanggaoFreeNumLimit);
  112. if ($user->privateState->dailyShop_GuangGaoNum >= 1) {
  113. my_Assert(now() - $user->privateState->dailyShop_GuangGaoTs >= $mo->downTs, ErrCode::user_shop_DownTsLimit);
  114. }
  115. $user->privateState->dailyShop_GuangGaoNum += 1;
  116. $user->privateState->dailyShop_GuangGaoTs = now();
  117. }
  118. } else {
  119. my_Assert(!in_array($typeId, $user->privateState->dailyShopReceived), ErrCode::user_shop_NotRepeatBuy);
  120. switch ($mo->costType) {
  121. case EnumShopCost::Gold:
  122. my_Assert($user->baseInfo->gold >= $mo->costNum, ErrCode::notenough_gold_msg);
  123. ctx()->baseInfo->Consume_Gold($mo->costNum);
  124. break;
  125. case EnumShopCost::Cash:
  126. my_Assert($user->baseInfo->cash >= $mo->costNum, ErrCode::notenough_cash_msg);
  127. ctx()->baseInfo->Consume_Cash($mo->costNum);
  128. break;
  129. default:
  130. break;
  131. }
  132. TaskProc::OnBuyNumDailyShop();
  133. }
  134. // $str = explode(',', $mo->reward);
  135. // if ($str[0] == 501) {//暂时还没有
  136. // }
  137. //$dailyArr
  138. StoreProc::AddMultiItemInStore($mo->reward);
  139. ctx()->privateState->dailyShopReceived[] = $typeId;
  140. break;
  141. case EnumShopGift::GemBox_Shop ://宝石宝箱
  142. $mo = GameConfig::shop_box_getItem($typeId);
  143. my_Assert($mo != null, ErrCode::err_const_no);
  144. if ($mo->type == 1) {
  145. if ($buyNum == 0) {
  146. $buyNum = 1;
  147. my_Assert(now() - $user->privateState->lastFreeGetTs_ShopBoxCommon >= $mo->freeDownTs * 24 * 60 * 60, ErrCode::user_shop_FreeNumLimit);
  148. $user->privateState->lastFreeGetTs_ShopBoxCommon = now();
  149. }
  150. } else if ($mo->type == 2) {
  151. if ($buyNum == 0) {
  152. $buyNum = 1;
  153. my_Assert(now() - $user->privateState->lastFreeGetTs_ShopBoxBright >= $mo->freeDownTs * 24 * 60 * 60, ErrCode::user_shop_FreeNumLimit);
  154. $user->privateState->lastFreeGetTs_ShopBoxBright = now();
  155. }
  156. }
  157. if ($buyNum == 1) {
  158. $cost = $mo->cost_one;
  159. $yaoshiArr = explode(',', $mo->cost_one_yaoshi);
  160. $itemId = $yaoshiArr[0];
  161. if (StlUtil::dictHasProperty(ctx()->store->items, $itemId) && ctx()->store->items[$itemId] >= $yaoshiArr[1]) {
  162. ctx()->store->removeItem($itemId, $yaoshiArr[1]);
  163. } else {
  164. my_Assert($user->baseInfo->cash >= $cost, ErrCode::notenough_cash_msg);
  165. $user->baseInfo->Consume_Cash($cost);
  166. }
  167. } elseif ($buyNum == 10) {
  168. $cost = $mo->cost_ten;
  169. my_Assert($user->baseInfo->cash >= $cost, ErrCode::notenough_cash_msg);
  170. $user->baseInfo->Consume_Cash($cost);
  171. }
  172. $arr = array();
  173. $arr[] = 1;
  174. $arr[] = 10;
  175. if (!in_array($buyNum, $arr)) {
  176. $buyNum = 1;
  177. }
  178. TaskProc::OnOpenNumBrightBox($typeId, $buyNum);
  179. TaskProc::OnOpenNumAnyBox($buyNum);
  180. $perList = explode(';', $mo->percent);
  181. $allNum = 0;
  182. foreach ($perList as $key => $value) {
  183. $str = explode(',', $value);
  184. $allNum += $str[1];
  185. }
  186. $allNum *= 10;
  187. for ($i = 0; $i < $buyNum; $i++) {
  188. mt_srand((double) microtime() * 1000000);
  189. $buyCount = 0;
  190. if ($mo->type == 1) {
  191. $user->privateState->buyNum_ShopBoxCommon += 1;
  192. $buyCount = $user->privateState->buyNum_ShopBoxCommon;
  193. } else {
  194. $user->privateState->buyNum_ShopBoxBright += 1;
  195. $buyCount = $user->privateState->buyNum_ShopBoxBright;
  196. }
  197. $bichu1 = explode(',', $mo->bichu1);
  198. $qual = 0;
  199. if ($buyCount % $bichu1[0] == 0) {
  200. $qual = $bichu1[1];
  201. }
  202. if ($mo->bichu2 != null) {
  203. $bichu2 = explode(',', $mo->bichu2);
  204. if ($buyCount % $bichu2[0] == 0) {
  205. $qual = $bichu2[1];
  206. }
  207. }
  208. if ($qual == 0) {
  209. $start = 0;
  210. $end = 0;
  211. $randNum = mt_rand(1, $allNum);
  212. foreach ($perList as $k => $val) {
  213. $str = explode(',', $val);
  214. $end += $str[1] * 10;
  215. if ($randNum > $start && $randNum <= $end) {
  216. $qual = $str[0];
  217. if ($qual == 4) {//自己加的控制概率的代码 多个出的紫色宝石 降低概率
  218. $descRand = mt_rand(1, 100);
  219. if ($descRand > 20 && $descRand <= 100) {
  220. $qual = 3;
  221. }
  222. }
  223. if ($qual == 5) {//自己加的控制概率的代码 多个出的金色宝石 降低概率
  224. $descRand = mt_rand(1, 100);
  225. if ($descRand > 10 && $descRand <= 100) {
  226. $qual = 4;
  227. }
  228. }
  229. if ($qual == 6) {//自己加的控制概率的代码 多个出的金色宝石 降低概率
  230. $descRand = mt_rand(1, 100);
  231. if ($descRand > 8 && $descRand <= 100) {
  232. $qual = 4;
  233. }
  234. }
  235. break;
  236. }
  237. $start = $end;
  238. }
  239. }
  240. if ($qual > 0) {
  241. $gemDic = GameConfig::gem();
  242. $gemList = array();
  243. foreach ($gemDic as $key => $value) {
  244. if ($value->qual == $qual) {
  245. $gemList[] = $value;
  246. }
  247. }
  248. $n = rand(0, count($gemList) - 1);
  249. $gem = StoreProc::initGem($gemList[$n]->typeId);
  250. if ($mo->type == 2) {
  251. SystemProc::GetGem_GreaterOrangeQual_ShopBox(req()->zoneid, ctx()->baseInfo->name, $gemList[$n]->typeId);
  252. }
  253. $resultArr[] = $gem->uid;
  254. StoreProc::PutGemInStore($gem);
  255. }
  256. }
  257. break;
  258. case EnumShopGift::BujiBox_Shop://补给箱
  259. $mo = GameConfig::shop_supply_getItem($typeId);
  260. my_Assert($mo != null, ErrCode::err_const_no);
  261. $list = explode(',', $mo->cost);
  262. my_Assert(StlUtil::dictHasProperty($user->store->items, $list[0]), ErrCode::notenough_item);
  263. $user->store->removeItem($list[0], $list[1]);
  264. $user->baseInfo->Add_Gold($mo->gold);
  265. if (!StlUtil::dictHasProperty($user->privateState->junbeiShopNumRecord, $typeId)) {
  266. $user->privateState->junbeiShopNumRecord->$typeId = 0;
  267. }
  268. $num = $user->privateState->junbeiShopNumRecord->$typeId += 1;
  269. if (!StlUtil::dictHasProperty($user->privateState->supplyBichuDic, $typeId)) {
  270. $user->privateState->supplyBichuDic->$typeId = 0;
  271. }
  272. $user->privateState->supplyBichuDic->$typeId += 1;
  273. my_Assert($num <= $mo->limitNum, ErrCode::user_shop_LimitNum);
  274. $list = explode(';', $mo->percent);
  275. $randNum = rand(0, 10000);
  276. $start = 0;
  277. $end = 0;
  278. $qual = null;
  279. foreach ($list as $item) {
  280. $arr = explode(',', $item);
  281. $per = $arr[2] * 100;
  282. $end += $per;
  283. if ($randNum >= $start && $randNum < $end) {
  284. $qual = $arr[0] . ',' . $arr[1]; //品阶,稀有度
  285. break;
  286. }
  287. $start = $end;
  288. }
  289. //必出
  290. $bichu = explode(',', $mo->bichu);
  291. $qArr = explode(',', $qual);
  292. if ($qArr[0] == $bichu[1] && $qArr[1] == $bichu[2]) {//得到必出,重置数量记录
  293. $user->privateState->supplyBichuDic->$typeId = 0;
  294. $qual = $bichu[1] . ',' . $bichu[2];
  295. } else {
  296. if ($user->privateState->supplyBichuDic->$typeId == $bichu[0]) {
  297. $qual = $bichu[1] . ',' . $bichu[2];
  298. $user->privateState->supplyBichuDic->$typeId = 0;
  299. }
  300. }
  301. if ($qual != null) {
  302. $str = explode(',', $qual);
  303. $equipList = array();
  304. $dic = GameConfig::equip();
  305. foreach ($dic as $tid => $item) {
  306. if ($item->qual == $str[0] && $item->rarity == $str[1]) {
  307. $equipList[] = $item->typeId;
  308. }
  309. }
  310. $rNum = rand(0, count($equipList) - 1);
  311. $equipId = $equipList[$rNum];
  312. StoreProc::PutEquipInStore($equipId, 1);
  313. $equip[] = $equipId;
  314. }
  315. break;
  316. case EnumShopGift::Cash_Shop://商城-钻石
  317. $mo = GameConfig::shop_cash_getItem($typeId);
  318. my_Assert($mo != null, ErrCode::err_const_no);
  319. $tag = false;
  320. if (in_array($typeId, $user->privateState->cashShopReceived)) {
  321. $tag = true;
  322. }
  323. $reward = $mo->reward;
  324. if (!$tag) {
  325. $reward = $mo->reward . ';' . $mo->reward;
  326. }
  327. StoreProc::AddMultiItemInStore($reward);
  328. $user->baseInfo->charge_amt += $mo->price;
  329. $user->privateState->cashShopReceived[] = $typeId;
  330. TaskProc::OnRecharge();
  331. break;
  332. case EnumShopGift::Gold_Shop://商城-金币--可以多次购买
  333. $mo = GameConfig::shop_gold_getItem($typeId);
  334. my_Assert($mo != null, ErrCode::err_const_no);
  335. $tempNum = 0;
  336. foreach ($user->privateState->goldShopReceived as $key) {
  337. if ($key == $typeId) {
  338. $tempNum += 1;
  339. }
  340. }
  341. if ($tempNum >= $mo->freeNum) {
  342. $ts = 0;
  343. switch ($typeId) {
  344. case 1:
  345. $ts = $user->privateState->goldShop_CoolDownTs_1;
  346. break;
  347. case 2:
  348. $ts = $user->privateState->goldShop_CoolDownTs_2;
  349. break;
  350. case 3:
  351. $ts = $user->privateState->goldShop_CoolDownTs_3;
  352. break;
  353. }
  354. //收费买
  355. if ($typeId == 1 && $user->privateState->goldShop_GuangGaoNum < $mo->guanggaoNum) {
  356. $user->privateState->goldShop_GuangGaoNum += 1;
  357. } else {
  358. my_Assert($user->baseInfo->cash >= $mo->price, ErrCode::notenough_cash_msg);
  359. ctx()->baseInfo->Consume_Cash($mo->price);
  360. }
  361. if ($ts == 0) {
  362. switch ($typeId) {
  363. case 1:
  364. $user->privateState->goldShop_CoolDownTs_1 = now();
  365. break;
  366. case 2:
  367. $user->privateState->goldShop_CoolDownTs_2 = now();
  368. break;
  369. case 3:
  370. $user->privateState->goldShop_CoolDownTs_3 = now();
  371. break;
  372. }
  373. //$user->privateState->goldShopReceived[] = $typeId;
  374. } else {
  375. my_Assert(now() - $ts >= $mo->downTs, ErrCode::user_shop_DownTsLimit);
  376. switch ($typeId) {
  377. case 1:
  378. $user->privateState->goldShop_CoolDownTs_1 = now();
  379. break;
  380. case 2:
  381. $user->privateState->goldShop_CoolDownTs_2 = now();
  382. break;
  383. case 3:
  384. $user->privateState->goldShop_CoolDownTs_3 = now();
  385. break;
  386. }
  387. }
  388. if ($typeId == 1 && $user->privateState->goldShop_GuangGaoNum >= $mo->guanggaoNum) {
  389. $user->privateState->goldShop_CoolDownTs_1 = 0;
  390. }
  391. }
  392. $user->privateState->goldShopReceived[] = $typeId;
  393. StoreProc::AddMultiItemInStore($mo->reward);
  394. break;
  395. case EnumShopGift::MonthCard_Shop:
  396. $mo = GameConfig::shop_monthcard_getItem($typeId);
  397. my_Assert($mo != null, ErrCode::err_const_no);
  398. //$user->privateState->monthCardShop_Received[] = $typeId;
  399. if ($typeId == 1) {
  400. my_Assert($user->privateState->monthCardShop_ts == 0, ErrCode::err_const_no);
  401. $user->privateState->monthCardShop_ts = now();
  402. StoreProc::AddMultiItemInStore($mo->buy_reward);
  403. EmailProc::SendMonthCardRewardMail(req()->zoneid, req()->uid, $mo->daily_reward);
  404. } else {
  405. my_Assert($user->privateState->honourCardShop_ts == 0, ErrCode::err_const_no);
  406. $user->privateState->honourCardShop_ts = now();
  407. }
  408. break;
  409. default:
  410. break;
  411. }
  412. // if (ctx()->baseInfo->charge_amt > 0 && ctx()->baseInfo->fRechargePriceReceived == 0) {
  413. // StoreProc::AddMultiItemInStore(GameConfig::globalsettings()->FirstRechargePrice);
  414. // ctx()->baseInfo->fRechargePriceReceived = 1;
  415. // }
  416. ctx($user);
  417. UserProc::updateUserInfo();
  418. return Resp::ok(array(
  419. 'gemBox' => $resultArr,
  420. 'gateGift' => $gateGift,
  421. 'cash' => $user->baseInfo->cash,
  422. 'gold' => $user->baseInfo->gold,
  423. 'privateState' => $user->privateState,
  424. 'store' => $user->store,
  425. 'task' => ctx()->task,
  426. 'reward' => StoreProc::$reward,
  427. 'reward_Gem' => StoreProc::$reward_Gem,
  428. ));
  429. }
  430. /**
  431. * 商城每日重置
  432. */
  433. public static function ShopDailyClear() {
  434. ctx()->privateState->dailyShopReceived = array();
  435. ctx()->privateState->goldShopReceived = array();
  436. $num = count(ctx()->privateState->goldShopReceived);
  437. $arr = ctx()->privateState->goldShopReceived;
  438. for ($i = 0; $i < $num; $i++) {
  439. if ($arr[$i] == 1) {
  440. StlUtil::arrayRemoveAt($arr, $i);
  441. }
  442. }
  443. ctx()->privateState->goldShop_CoolDownTs_1 = 0;
  444. ctx()->privateState->goldShop_GuangGaoNum = 0;
  445. ctx()->privateState->junbeiShopNumRecord = new \stdClass();
  446. ctx()->privateState->dailyShop_GuangGaoNum = 0;
  447. ctx()->privateState->dailyShop_GuangGaoTs = 0;
  448. ctx()->privateState->guanggaoGetTiliNum = 0;
  449. ctx()->privateState->buyTiliNum = 0;
  450. self::ShopMonthClear();
  451. }
  452. /**
  453. * 月卡按照时间记录的一个月后清理
  454. */
  455. public static function ShopMonthClear() {
  456. $monthTs = 30 * 24 * 60 * 60;
  457. if (ctx()->privateState->monthCardShop_ts > 0) {
  458. if (now() - ctx()->privateState->monthCardShop_ts >= $monthTs) {
  459. ctx()->privateState->monthCardShop_ts = 0;
  460. } else {
  461. $mo = GameConfig::shop_monthcard_getItem(1);
  462. EmailProc::SendMonthCardRewardMail(req()->zoneid, req()->uid, $mo->daily_reward);
  463. }
  464. }
  465. if (ctx()->privateState->honourCardShop_ts > 0 && now() - ctx()->privateState->honourCardShop_ts >= $monthTs) {
  466. ctx()->privateState->honourCardShop_ts = 0;
  467. }
  468. }
  469. /**
  470. * 每日商城随机6个道具
  471. * @return type
  472. */
  473. public static function DailyShopItemRand() {
  474. $dataDic = new \stdClass();
  475. $dic = GameConfig::shop_daily();
  476. if ($dic == null) {
  477. return;
  478. }
  479. foreach ($dic as $typeId => $mo) {
  480. $type = $mo->type;
  481. if (StlUtil::dictHasProperty($dataDic, $type)) {
  482. $list = $dataDic->$type;
  483. $list[] = $typeId;
  484. $dataDic->$type = $list;
  485. } else {
  486. $list = array();
  487. $list[] = $typeId;
  488. $dataDic->$type = $list;
  489. }
  490. }
  491. $result = array();
  492. $arrType = array(1, 2, 3, 2, 4, 3);
  493. foreach ($arrType as $k) {
  494. if (StlUtil::dictHasProperty($dataDic, $k) && count($dataDic->$k) > 0) {
  495. $arr2 = $dataDic->$k;
  496. if ($k == 1) {
  497. $result[] = $arr2[0];
  498. continue;
  499. }
  500. $allNum = 0;
  501. foreach ($arr2 as $giftTypeId) {
  502. $allNum += GameConfig::shop_daily_getItem($giftTypeId)->per;
  503. }
  504. $randNum = rand(1, $allNum);
  505. $start = 0;
  506. $end = 0;
  507. $index = 0;
  508. foreach ($arr2 as $itemId) {
  509. $per = GameConfig::shop_daily_getItem($itemId)->per;
  510. $end += $per;
  511. if ($randNum >= $start && $randNum < $end) {
  512. $result[] = $itemId;
  513. break;
  514. }
  515. $start = $end;
  516. $index += 1;
  517. }
  518. unset($arr2[$index]);
  519. $dataDic->$k = array_values($arr2);
  520. }
  521. }
  522. ctx()->privateState->dailyShopRandItems = $result;
  523. UserProc::updateUserInfo();
  524. }
  525. }