setAdminCurItem('index'); return View::fetch('index'); } /** * 基本设置 */ public function setting(){ $config_model = model('config'); if (request()->isPost()) { $update_array = array(); $update_array['promotion_allow'] = intval(input('post.promotion_allow')); $update_array['groupbuy_allow'] = intval(input('post.groupbuy_allow')); $update_array['points_isuse'] = intval(input('post.points_isuse')); $update_array['pointshop_isuse'] = input('post.pointshop_isuse'); $update_array['voucher_allow'] = input('post.voucher_allow'); $update_array['mgdiscount_allow'] = input('post.mgdiscount_allow'); $update_array['pointprod_isuse'] = input('post.pointprod_isuse'); $update_array['points_signin_isuse'] = input('post.points_signin_isuse'); $result = $config_model->editConfig($update_array); if ($result === true) { $this->log(lang('ds_edit') . lang('ds_operation') . lang('ds_operation_set'), 1); $this->success(lang('ds_common_save_succ')); } else { $this->error(lang('ds_common_save_fail')); } } else { $list_setting = rkcache('config', true); View::assign('list_setting', $list_setting); $this->setAdminCurItem('setting'); return View::fetch('setting'); } } public function point_signin(){ $config_model = model('config'); if(!request()->isPost()){ $list_setting = rkcache('config', true); View::assign('list_setting', $list_setting); return View::fetch('point_signin'); }else{ $update_array = array(); $update_array['points_signin_isuse'] = input('post.points_signin_isuse'); $update_array['points_signin'] = intval(input('post.points_signin')); $update_array['points_signin_cycle'] = intval(input('post.points_signin_cycle')); $update_array['points_signin_reward'] = intval(input('post.points_signin_reward')); $result = $config_model->editConfig($update_array); if ($result === true) { $this->success(lang('ds_common_save_succ')); } else { $this->error(lang('ds_common_save_fail')); } } } /** * 获取卖家栏目列表,针对控制器下的栏目 */ protected function getAdminItemList() { $menu_array = array( array( 'name' => 'index', 'text' => '营销中心', 'url' => url('Operation/index') ), array( 'name' => 'setting', 'text' => '基本设置', 'url' => url('Operation/setting') ), ); return $menu_array; } }