StockStatusController.class.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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 Admin\Controller;
  15. use Admin\Model\StockStatusModel;
  16. class StockStatusController extends CommonController{
  17. protected function _initialize(){
  18. parent::_initialize();
  19. $this->breadcrumb1='商品';
  20. $this->breadcrumb2='库存状态';
  21. }
  22. public function index(){
  23. $model=new StockStatusModel();
  24. $data=$model->show_stock_status_page();
  25. $this->assign('empty',$data['empty']);// 赋值数据集
  26. $this->assign('list',$data['list']);// 赋值数据集
  27. $this->assign('page',$data['page']);// 赋值分页输出
  28. $this->display();
  29. }
  30. function add(){
  31. if(IS_POST){
  32. $model=new StockStatusModel();
  33. $data=I('post.');
  34. $return=$model->add_stock_status($data);
  35. $this->osc_alert($return);
  36. }
  37. $this->crumbs='新增';
  38. $this->action=U('StockStatus/add');
  39. $this->display('edit');
  40. }
  41. function edit(){
  42. if(IS_POST){
  43. $model=new StockStatusModel();
  44. $data=I('post.');
  45. $return=$model->edit_stock_status($data);
  46. $this->osc_alert($return);
  47. }
  48. $this->crumbs='编辑';
  49. $this->action=U('StockStatus/edit');
  50. $this->d=M('StockStatus')->find(I('id'));
  51. $this->display('edit');
  52. }
  53. public function del(){
  54. $model=new StockStatusModel();
  55. $return=$model->del_stock_status();
  56. $this->osc_alert($return);
  57. }
  58. }
  59. ?>