ExpressProvince.php 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | framework
  4. // +----------------------------------------------------------------------
  5. // | 版权所有 2014~2018 广州楚才信息科技有限公司 [ http://www.cuci.cc ]
  6. // +----------------------------------------------------------------------
  7. // | 官方网站: http://framework.thinkadmin.top
  8. // +----------------------------------------------------------------------
  9. // | 开源协议 ( https://mit-license.org )
  10. // +----------------------------------------------------------------------
  11. // | github开源项目:https://github.com/zoujingli/framework
  12. // +----------------------------------------------------------------------
  13. namespace app\store\controller;
  14. use library\Controller;
  15. /**
  16. * 配送省份管理
  17. * Class Area
  18. * @package app\store\controller
  19. */
  20. class ExpressProvince extends Controller
  21. {
  22. /**
  23. * 绑定数据表
  24. * @var string
  25. */
  26. protected $table = 'StoreExpressProvince';
  27. /**
  28. * 配送省份管理
  29. * @throws \think\Exception
  30. * @throws \think\db\exception\DataNotFoundException
  31. * @throws \think\db\exception\ModelNotFoundException
  32. * @throws \think\exception\DbException
  33. * @throws \think\exception\PDOException
  34. */
  35. public function index()
  36. {
  37. $this->title = '配送省份管理';
  38. $this->_query($this->table)->like('title')->equal('status')->dateBetween('create_at')->order('sort asc,id desc')->page();
  39. }
  40. /**
  41. * 添加配送省份
  42. */
  43. public function add()
  44. {
  45. $this->applyCsrfToken();
  46. $this->_form($this->table, 'form');
  47. }
  48. /**
  49. * 编辑配送省份
  50. */
  51. public function edit()
  52. {
  53. $this->applyCsrfToken();
  54. $this->_form($this->table, 'form');
  55. }
  56. /**
  57. * 启用配送省份
  58. */
  59. public function resume()
  60. {
  61. $this->applyCsrfToken();
  62. $this->_save($this->table, ['status' => '1']);
  63. }
  64. /**
  65. * 禁用配送省份
  66. */
  67. public function forbid()
  68. {
  69. $this->applyCsrfToken();
  70. $this->_save($this->table, ['status' => '0']);
  71. }
  72. /**
  73. * 删除配送省份
  74. */
  75. public function remove()
  76. {
  77. $this->applyCsrfToken();
  78. $this->_delete($this->table);
  79. }
  80. }