PluginsSliderController.class.php 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <?php
  2. /**
  3. * lionfish 商城系统
  4. *
  5. * ==========================================================================
  6. * @link http://www.liofis.com/
  7. * @copyright Copyright (c) 2015 liofis.com.
  8. * @license http://www.liofis.com/license.html License
  9. * ==========================================================================
  10. *
  11. * @author fish
  12. *
  13. */
  14. namespace Admin\Controller;
  15. use Admin\Model\PluginsSliderModel;
  16. class PluginsSliderController extends CommonController {
  17. protected function _initialize(){
  18. parent::_initialize();
  19. $this->breadcrumb1='插件';
  20. $this->breadcrumb2='广告位';
  21. $this->type_config = array('index_ad_nav' => '首页导航','index_ad_head' => '首页滚动广告',
  22. 'index_ad_list' => '首页横条广告','pc_ad_head'=>'PC首页头部广告',
  23. 'pc_ad_scroll'=>'PC首页滚动广告','pc_news' =>'PC关于我们广告图','index_wepro_head' =>'小程序首页滚动广告',
  24. 'index_wepro_line' => '小程序首页横向广告', 'pin_index_ad' =>'拼团首页单图',
  25. 'lottery_wepro_head' =>'小程序抽奖首页单图','newman_wepro_head' =>'小程序老带新首页单图',
  26. 'index_wepro_iconnav' =>'小程序首页小图标导航',
  27. 'index_wepro_ziying_line' => '小程序自营首页横条广告','paihang_wepro_head' => '小程序自营排行横条广告',
  28. 'new_wepro_head' => '小程序自营新品横条广告'
  29. );
  30. }
  31. public function index(){
  32. $model=new PluginsSliderModel();
  33. $data=$model->show_slider_page();
  34. $this->assign('empty',$data['empty']);// 赋值数据集
  35. $this->assign('list',$data['list']);// 赋值数据集
  36. $this->assign('page',$data['page']);// 赋值分页输出
  37. $this->display();
  38. }
  39. function add(){
  40. if(IS_POST){
  41. $model=new PluginsSliderModel();
  42. $data=I('post.');
  43. $return=$model->add_slider($data);
  44. $this->osc_alert($return);
  45. }
  46. $this->crumbs='新增';
  47. $this->action=U('PluginsSlider/add');
  48. $this->display('edit');
  49. }
  50. function edit(){
  51. if(IS_POST){
  52. $model=new PluginsSliderModel();
  53. $data=I('post.');
  54. $return=$model->edit_slider($data);
  55. $this->osc_alert($return);
  56. }
  57. $this->crumbs='编辑';
  58. $this->action=U('PluginsSlider/edit');
  59. $this->slider=M('PluginsSlider')->find(I('id'));
  60. $this->thumb_image=resize($this->slider['image'], 100, 100);
  61. $this->display('edit');
  62. }
  63. public function del(){
  64. $r=M('PluginsSlider')->delete(I('id'));
  65. if($r){
  66. $this->redirect('PluginsSlider/index');
  67. }
  68. }
  69. }