1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <?php
- /**
- * 狮子鱼社区团购系统
- *
- *
- * @author fish
- *
- */
- namespace Home\Widget;
- use Think\Controller;
- /**
- * 轮播器
- */
- class SliderWidget extends Controller{
-
- function slider_show(){
- if (!$slider_cache = S('slider_cache')) {
- $slider=M('plugins_slider')->where( array('type' => 'index_ad_head') )->field('image,url')->order('sort_order desc')->select();
- S('slider_cache', $slider);
- $slider_cache=$slider;
- }
- $this->slider=$slider_cache;
- $this->display('Widget:slider');
- }
- function slider_seller_show($seller_id)
- {
- if (!$slider_cache = S('slider_seller_cache_'.$seller_id) ) {
-
- $slider=M('seller_ad')->where( array('seller_id' => $seller_id) )->field('image,url')->order('ordersort desc,id asc')->select();
- S('slider_seller_cache_'.$seller_id, $slider);
- $slider_cache=$slider;
- }
- $this->slider=$slider_cache;
- $this->display('Widget:slider_seller');
- }
- /**
- 首页横条广告位
- **/
- function slider_show_list(){
- if (!$slider_cache = S('slider_list_cache')) {
- $slider=M('plugins_slider')->where( array('type' => 'index_ad_list') )->field('image,url')->order('sort_order desc,slider_id desc')->select();
- S('slider_list_cache', $slider);
- $slider_cache=$slider;
- }
- $this->slider=$slider_cache;
- $this->display('Widget:slider_list');
- }
-
- }
|