用户下单session临时数据改为cache

feat/task1-c-wallet
gongfuxiang 2023-04-20 23:13:04 +08:00
parent c44acbe6b9
commit 47eae4577b
1 changed files with 3 additions and 2 deletions

View File

@ -53,9 +53,10 @@ class Buy extends Common
*/ */
public function Index() public function Index()
{ {
$key = 'buy_post_data_'.$this->user['id'];
if($this->data_post) if($this->data_post)
{ {
MySession('buy_post_data', $this->data_post); MyCache($key, $this->data_post, 1800);
return MyRedirect(MyUrl('index/buy/index')); return MyRedirect(MyUrl('index/buy/index'));
} else { } else {
// 站点类型,是否开启了展示型 // 站点类型,是否开启了展示型
@ -66,7 +67,7 @@ class Buy extends Common
} }
// 获取下单信息 // 获取下单信息
$buy_data = MySession('buy_post_data'); $buy_data = MyCache($key);
if(empty($buy_data) || (empty($buy_data['goods_data']) && empty($buy_data['ids']))) if(empty($buy_data) || (empty($buy_data['goods_data']) && empty($buy_data['ids'])))
{ {
MyViewAssign('msg', MyLang('goods_data_empty_tips')); MyViewAssign('msg', MyLang('goods_data_empty_tips'));