Sellercallcenter.php 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. <?php
  2. namespace app\home\controller;
  3. use think\facade\View;
  4. use think\facade\Lang;
  5. /**
  6. * ============================================================================
  7. * DSMall多用户商城
  8. * ============================================================================
  9. * 版权所有 2014-2028 长沙德尚网络科技有限公司,并保留所有权利。
  10. * 网站地址: http://www.csdeshang.com
  11. * ----------------------------------------------------------------------------
  12. * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和使用 .
  13. * 不允许对程序代码以任何形式任何目的的再发布。
  14. * ============================================================================
  15. * 控制器
  16. */
  17. class Sellercallcenter extends BaseSeller {
  18. public function initialize() {
  19. parent::initialize(); // TODO: Change the autogenerated stub
  20. Lang::load(base_path() . 'home/lang/'.config('lang.default_lang').'/sellercallcenter.lang.php');
  21. }
  22. public function index() {
  23. $store_model = model('store');
  24. $store_info = $store_model->getStoreInfo(array('store_id' => session('store_id')));
  25. View::assign('storeinfo', $store_info);
  26. $seller_model = model('seller');
  27. $seller_list = $seller_model->getSellerList(array('seller.store_id' => $store_info['store_id']), 'seller.seller_id asc'); //账号列表
  28. $this->setSellerCurMenu('Sellercallcenter');
  29. $this->setSellerCurItem('index');
  30. View::assign('seller_list', $seller_list);
  31. return View::fetch($this->template_dir . 'index');
  32. }
  33. /**
  34. * 保存
  35. */
  36. public function save() {
  37. if (request()->isPost()) {
  38. $update = array();
  39. $i = 0;
  40. $pre_array = input('post.pre/a');#获取数组
  41. if (is_array($pre_array) && !empty($pre_array)) {
  42. foreach ($pre_array as $val) {
  43. if (empty($val['name']) || empty($val['type']) || empty($val['num']))
  44. continue;
  45. $update['store_presales'][$i]['name'] = $val['name'];
  46. $update['store_presales'][$i]['type'] = intval($val['type']);
  47. $update['store_presales'][$i]['num'] = $val['num'];
  48. $i++;
  49. }
  50. $update['store_presales'] = @serialize($update['store_presales']);
  51. }
  52. else {
  53. $update['store_presales'] = serialize(null);
  54. }
  55. $i = 0;
  56. $after_array = input('post.after/a');#获取数组
  57. if (is_array($after_array) && !empty($after_array)) {
  58. foreach ($after_array as $val) {
  59. if (empty($val['name']) || empty($val['type']) || empty($val['num']))
  60. continue;
  61. $update['store_aftersales'][$i]['name'] = $val['name'];
  62. $update['store_aftersales'][$i]['type'] = intval($val['type']);
  63. $update['store_aftersales'][$i]['num'] = $val['num'];
  64. $i++;
  65. }
  66. $update['store_aftersales'] = @serialize($update['store_aftersales']);
  67. }
  68. else {
  69. $update['store_aftersales'] = serialize(null);
  70. }
  71. $update['store_workingtime'] = input('post.working_time');
  72. $condition = array();
  73. $condition[] = array('store_id','=',session('store_id'));
  74. model('store')->editStore($update, $condition);
  75. ds_json_encode(10000,lang('ds_common_save_succ'));
  76. }
  77. }
  78. /**
  79. * 用户中心右边,小导航
  80. *
  81. * @param string $menu_type 导航类型
  82. * @param string $menu_key 当前导航的menu_key
  83. * @return
  84. */
  85. protected function getSellerItemList() {
  86. $menu_array = array(
  87. array(
  88. 'name' => 'index', 'text' => lang('ds_member_path_store_callcenter'),
  89. 'url' => (string)url('Sellercallcenter/index')
  90. ),
  91. );
  92. return $menu_array;
  93. }
  94. }