PluginsSliderController.class.php 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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. }
  39. public function index(){
  40. $model=new PluginsSliderModel();
  41. $data=$model->show_slider_page();
  42. $this->assign('empty',$data['empty']);// 赋值数据集
  43. $this->assign('list',$data['list']);// 赋值数据集
  44. $this->assign('page',$data['page']);// 赋值分页输出
  45. $this->display();
  46. }
  47. function add(){
  48. if(IS_POST){
  49. $model=new PluginsSliderModel();
  50. $data=I('post.');
  51. $return=$model->add_slider($data);
  52. $this->osc_alert($return);
  53. }
  54. $this->crumbs='新增';
  55. $this->action=U('PluginsSliderdan/add');
  56. $this->display('edit');
  57. }
  58. function edit(){
  59. if(IS_POST){
  60. $model=new PluginsSliderModel();
  61. $data=I('post.');
  62. $return=$model->edit_slider($data);
  63. $this->osc_alert($return);
  64. }
  65. $this->crumbs='编辑';
  66. $this->action=U('PluginsSlider/edit');
  67. $this->slider=M('PluginsSlider')->find(I('id'));
  68. $this->thumb_image=resize($this->slider['image'], 100, 100);
  69. $this->display('edit');
  70. }
  71. public function del(){
  72. $r=M('PluginsSlider')->delete(I('id'));
  73. if($r){
  74. $this->redirect('PluginsSlider/index');
  75. }
  76. }
  77. }