Operation.php 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. <?php
  2. /**
  3. * 营销设置
  4. */
  5. namespace app\admin\controller;
  6. use think\facade\View;
  7. use think\facade\Lang;
  8. /**
  9. * ============================================================================
  10. * DSMall多用户商城
  11. * ============================================================================
  12. * 版权所有 2014-2028 长沙德尚网络科技有限公司,并保留所有权利。
  13. * 网站地址: http://www.csdeshang.com
  14. * ----------------------------------------------------------------------------
  15. * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和使用 .
  16. * 不允许对程序代码以任何形式任何目的的再发布。
  17. * ============================================================================
  18. * 控制器
  19. */
  20. class Operation extends AdminControl
  21. {
  22. public function initialize()
  23. {
  24. parent::initialize(); // TODO: Change the autogenerated stub
  25. Lang::load(base_path().'admin/lang/'.config('lang.default_lang').'/config.lang.php');
  26. }
  27. public function index(){
  28. $this->setAdminCurItem('index');
  29. return View::fetch('index');
  30. }
  31. /**
  32. * 基本设置
  33. */
  34. public function setting(){
  35. $config_model = model('config');
  36. if (request()->isPost()) {
  37. $update_array = array();
  38. $update_array['goods_verify'] = intval(input('post.goods_verify')) ;
  39. $update_array['flea_isuse'] = intval(input('post.flea_isuse'));
  40. $update_array['promotion_allow'] = intval(input('post.promotion_allow'));
  41. $update_array['groupbuy_allow'] = intval(input('post.groupbuy_allow'));
  42. $update_array['points_isuse'] = intval(input('post.points_isuse'));
  43. $update_array['pointshop_isuse'] = input('post.pointshop_isuse');
  44. $update_array['voucher_allow'] = input('post.voucher_allow');
  45. $update_array['mgdiscount_allow'] = input('post.mgdiscount_allow');
  46. $update_array['member_auth'] = input('post.member_auth');
  47. $update_array['pointprod_isuse'] = input('post.pointprod_isuse');
  48. $result = $config_model->editConfig($update_array);
  49. if ($result === true) {
  50. $this->log(lang('ds_edit') . lang('ds_operation') . lang('ds_operation_set'), 1);
  51. $this->success(lang('ds_common_save_succ'));
  52. } else {
  53. $this->error(lang('ds_common_save_fail'));
  54. }
  55. } else {
  56. $list_setting = rkcache('config', true);
  57. View::assign('list_setting', $list_setting);
  58. $this->setAdminCurItem('setting');
  59. return View::fetch('setting');
  60. }
  61. }
  62. public function point_signin(){
  63. $config_model = model('config');
  64. if(!request()->isPost()){
  65. $list_setting = rkcache('config', true);
  66. View::assign('list_setting', $list_setting);
  67. return View::fetch('point_signin');
  68. }else{
  69. $update_array = array();
  70. $update_array['points_signin_isuse'] = input('post.points_signin_isuse');
  71. $update_array['points_signin'] = intval(input('post.points_signin'));
  72. $update_array['points_signin_cycle'] = intval(input('post.points_signin_cycle'));
  73. $update_array['points_signin_reward'] = intval(input('post.points_signin_reward'));
  74. $result = $config_model->editConfig($update_array);
  75. if ($result === true) {
  76. $this->success(lang('ds_common_save_succ'));
  77. } else {
  78. $this->error(lang('ds_common_save_fail'));
  79. }
  80. }
  81. }
  82. /**
  83. * 获取卖家栏目列表,针对控制器下的栏目
  84. */
  85. protected function getAdminItemList() {
  86. $menu_array = array(
  87. array(
  88. 'name' => 'index',
  89. 'text' => lang('ds_operation_set'),
  90. 'url' => (string)url('Operation/index')
  91. ),
  92. array(
  93. 'name' => 'setting',
  94. 'text' => lang('base_setting'),
  95. 'url' => (string)url('Operation/setting')
  96. ),
  97. );
  98. return $menu_array;
  99. }
  100. }