|
@@ -46,8 +46,19 @@ class Index extends Api
|
|
|
$index_show_product = $productModel->field('id,image,title')->where($map)->find();
|
|
|
$index_show_product = info_domain_image($index_show_product,['image']);
|
|
|
|
|
|
+ //登录之后,首页商品一天只弹一次
|
|
|
+ if($this->auth->isLogin()){
|
|
|
+
|
|
|
+ $key = date('Y-m-d').'-'.$this->auth->id;
|
|
|
+ if(cache($key) == 1){
|
|
|
+ $index_show_product = null;
|
|
|
+ }else{
|
|
|
+ cache($key,1,86400);
|
|
|
+ }
|
|
|
|
|
|
+ }
|
|
|
|
|
|
+ //
|
|
|
$result = [
|
|
|
'tag' => $tag,
|
|
|
'sys' => $sys,
|
|
@@ -60,7 +71,15 @@ class Index extends Api
|
|
|
|
|
|
}
|
|
|
|
|
|
+ public function test(){
|
|
|
+ $key = date('Y-m-d').'-'.$this->auth->id;
|
|
|
+ dump(cache($key));
|
|
|
+ }
|
|
|
|
|
|
+ public function clean(){
|
|
|
+ $key = date('Y-m-d').'-'.$this->auth->id;
|
|
|
+ cache($key,null);
|
|
|
+ }
|
|
|
|
|
|
|
|
|
}
|