PluginsSliderController.class.php 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. <?php
  2. /**
  3. * 小梦科技资源nanodreamtech.com
  4. *
  5. * ==========================================================================
  6. * @link https://www.nanodreamtech.com/
  7. * @copyright Copyright (c) 2015 liofis.com.
  8. * @license https://www.nanodreamtech.com/license.html License
  9. * ==========================================================================
  10. *
  11. * @author fish
  12. *
  13. */
  14. namespace Seller\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. //
  22. $this->type_config = array(
  23. 'index_ad_nav' => '首页导航',
  24. 'index_ad_head' => '首页滚动广告',
  25. 'index_ad_list' => '首页横条广告',
  26. 'lottery_wepro_head' =>'小程序抽奖首页单图',
  27. 'newman_wepro_head' =>'小程序老带新首页单图',
  28. 'index_wepro_line' => '小程序自营首页横条广告(2图)',
  29. 'index_wepro_ziying_line' => '小程序自营首页横条广告(1图)',
  30. 'index_wepro_head' =>'小程序首页滚动广告',
  31. 'paihang_wepro_head' => '小程序自营排行横条广告',
  32. 'index_wepro_iconnav' =>'小程序首页小图标导航',
  33. 'new_wepro_head' => '小程序自营新品横条广告',
  34. 'wepro_bargain_ad' => '小程序自营砍价顶部广告',
  35. 'wepro_integral_mall' => '小程序自营积分商城顶部广告',
  36. 'wepro_integral_mall_bottom' => '小程序积分详情底部广告',
  37. );
  38. if($this->system_hide_wepro)
  39. {//隐藏小程序,显示服务号
  40. $this->type_config = array(
  41. 'index_ad_nav' => '首页导航',
  42. 'index_ad_head' => '首页滚动广告',
  43. 'index_ad_list' => '首页横条广告',
  44. 'index_wepro_line' => '首页横条广告(2图)',
  45. 'pin_index_ad' =>'拼团首页广告',
  46. 'lottery_wepro_head' =>'抽奖团广告',
  47. 'newman_wepro_head' =>'老带新广告',
  48. 'wepro_integral_mall' => '积分商城顶部广告',
  49. 'wepro_bargain_ad' => '砍价顶部广告',
  50. );
  51. }
  52. if($this->system_hide_dan)
  53. {//隐藏服务号,显示小程序
  54. $this->type_config = array(
  55. 'lottery_wepro_head' =>'小程序抽奖首页单图',
  56. 'newman_wepro_head' =>'小程序老带新首页单图',
  57. 'index_wepro_line' => '小程序自营首页横条广告(2图)',
  58. 'index_wepro_ziying_line' => '小程序自营首页横条广告(1图)',
  59. 'index_wepro_head' =>'小程序首页滚动广告',
  60. 'paihang_wepro_head' => '小程序自营排行横条广告',
  61. 'index_wepro_iconnav' =>'小程序首页小图标导航',
  62. 'new_wepro_head' => '小程序自营新品横条广告',
  63. 'wepro_bargain_ad' => '小程序自营砍价顶部广告',
  64. 'wepro_integral_mall' => '小程序自营积分商城顶部广告',
  65. 'wepro_integral_mall_bottom' => '小程序积分详情底部广告',
  66. );
  67. }
  68. }
  69. public function index(){
  70. $model=new PluginsSliderModel();
  71. $data=$model->show_slider_page();
  72. $this->assign('empty',$data['empty']);// 赋值数据集
  73. $this->assign('list',$data['list']);// 赋值数据集
  74. $this->assign('page',$data['page']);// 赋值分页输出
  75. $this->display();
  76. }
  77. function add(){
  78. if(IS_POST){
  79. $model=new PluginsSliderModel();
  80. $data=I('post.');
  81. $return=$model->add_slider($data);
  82. $this->osc_alert($return);
  83. }
  84. $this->crumbs='新增';
  85. $this->action=U('PluginsSliderdan/add');
  86. $this->display('edit');
  87. }
  88. function edit(){
  89. if(IS_POST){
  90. $model=new PluginsSliderModel();
  91. $data=I('post.');
  92. $return=$model->edit_slider($data);
  93. $this->osc_alert($return);
  94. }
  95. $this->crumbs='编辑';
  96. $this->action=U('PluginsSlider/edit');
  97. $this->slider=M('PluginsSlider')->find(I('id'));
  98. $this->thumb_image=resize($this->slider['image'], 100, 100);
  99. $this->display('edit');
  100. }
  101. public function del(){
  102. $r=M('PluginsSlider')->delete(I('id'));
  103. if($r){
  104. $this->redirect('PluginsSlider/index');
  105. }
  106. }
  107. }