OrderStatusController.class.php 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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\OrderStatusModel;
  16. class OrderStatusController extends CommonController{
  17. protected function _initialize(){
  18. parent::_initialize();
  19. $this->breadcrumb1='订单';
  20. $this->breadcrumb2='订单状态';
  21. }
  22. public function index(){
  23. $model=new OrderStatusModel();
  24. $data=$model->show_order_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 OrderStatusModel();
  33. $data=I('post.');
  34. $return=$model->add_order_status($data);
  35. $this->osc_alert($return);
  36. }
  37. $this->crumbs='新增';
  38. $this->action=U('OrderStatus/add');
  39. $this->display('edit');
  40. }
  41. function edit(){
  42. if(IS_POST){
  43. $model=new OrderStatusModel();
  44. $data=I('post.');
  45. $return=$model->edit_order_status($data);
  46. $this->osc_alert($return);
  47. }
  48. $this->crumbs='编辑';
  49. $this->action=U('OrderStatus/edit');
  50. $this->d=M('OrderStatus')->find(I('id'));
  51. $this->display('edit');
  52. }
  53. public function del(){
  54. $model=new OrderStatusModel();
  55. $return=$model->del_order_status();
  56. $this->osc_alert($return);
  57. }
  58. }
  59. ?>