express.php 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?php
  2. /**
  3. * 快递公司
  4. *
  5. *
  6. *
  7. ***/
  8. defined('InShopNC') or exit('Access Invalid!');
  9. class expressControl extends SystemControl{
  10. public function __construct(){
  11. parent::__construct();
  12. Language::read('express');
  13. }
  14. public function indexOp(){
  15. $lang = Language::getLangContent();
  16. $model = Model('express');
  17. if (preg_match('/^[A-Z]$/',$_GET['letter'])){
  18. $model->where(array('e_letter'=>$_GET['letter']));
  19. }
  20. $list = $model->page(10)->order('e_order,e_state desc,id')->select();
  21. Tpl::output('page',$model->showpage());
  22. Tpl::output('list',$list);
  23. Tpl::showpage('express.index');
  24. }
  25. /**
  26. * ajax操作
  27. */
  28. public function ajaxOp(){
  29. switch ($_GET['branch']){
  30. case 'state':
  31. $model_brand = Model('express');
  32. $update_array = array();
  33. $update_array['id'] = intval($_GET['id']);
  34. $update_array[$_GET['column']] = trim($_GET['value']);
  35. $model_brand->update($update_array);
  36. dkcache('express');
  37. $this->log(L('nc_edit,express_name,express_state').'[ID:'.intval($_GET['id']).']',1);
  38. echo 'true';exit;
  39. break;
  40. case 'order':
  41. $_GET['value'] = $_GET['value'] == 0? 2:1;
  42. $model_brand = Model('express');
  43. $update_array = array();
  44. $update_array['id'] = intval($_GET['id']);
  45. $update_array[$_GET['column']] = trim($_GET['value']);
  46. $model_brand->update($update_array);
  47. dkcache('express');
  48. $this->log(L('nc_edit,express_name,express_state').'[ID:'.intval($_GET['id']).']',1);
  49. echo 'true';exit;
  50. break;
  51. case 'e_zt_state':
  52. $model_brand = Model('express');
  53. $update_array = array();
  54. $update_array['id'] = intval($_GET['id']);
  55. $update_array[$_GET['column']] = trim($_GET['value']);
  56. $model_brand->update($update_array);
  57. dkcache('express');
  58. $this->log(L('nc_edit,express_name,express_state').'[ID:'.intval($_GET['id']).']',1);
  59. echo 'true';exit;
  60. break;
  61. }
  62. dkcache('express');
  63. }
  64. }