123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- <?php
-
-
- namespace app\admin\controller;
-
- use think\Db;
- use think\Config;
-
- class UsersRelease extends Base {
-
- public $current_channel = [1,3,4,5];
- public function __construct(){
- parent::__construct();
-
-
- $this->UsersConfigData = getUsersConfigData('all');
- $this->assign('userConfig',$this->UsersConfigData);
-
-
- $channeltype_row = \think\Cache::get('extra_global_channeltype');
- $this->assign('channeltype_row',$channeltype_row);
-
- }
-
-
-
- public function conf(){
- if (IS_AJAX) {
- $is_automatic_review = input('param.is_automatic_review/d', 0);
- $is_open_posts_count = input('param.is_open_posts_count/d', 0);
- $release_typeids = input('param.release_typeids/s', '');
- $typeids = !empty($release_typeids) ? explode(',', $release_typeids) : [];
-
- $confData = [
- 'is_automatic_review' => $is_automatic_review,
- 'is_open_posts_count' => $is_open_posts_count,
- 'release_default_id' => !empty($typeids[0]) ? intval($typeids[0]) : 0,
- ];
- getUsersConfigData('users', $confData);
-
-
-
- $where = [
- 'id' => ['IN', $typeids],
- ];
- if (0 == $typeids[0]) {
- $where = [
- 'current_channel' => ['in',$this->current_channel],
- 'lang' => $this->admin_lang,
- ];
- }
- $update = [
- 'is_release' => 1,
- 'update_time' => getTime(),
- ];
- if (!empty($where) && !empty($update)) {
-
- Db::name('arctype')->where([
- 'current_channel' => ['in',$this->current_channel],
- 'lang' => $this->admin_lang,
- ])->update([
- 'is_release' => 0,
- 'update_time' => getTime(),
- ]);
-
-
-
- Db::name('arctype')->where($where)->update($update);
-
- }
-
-
- $this->success('设置成功!');
- }
-
- $UsersC = getUsersConfigData('users');
- $this->assign('UsersC',$UsersC);
-
- $arctype = Db::name('arctype')->where([
- 'current_channel' => ['in',$this->current_channel],
- 'is_release' => 1,
- 'lang' => $this->admin_lang,
- ])->field('id')->select();
- $arctype = get_arr_column($arctype,'id');
- $select_html = allow_release_arctype($arctype, $this->current_channel);
- if (empty($this->current_channel)){
- $select_html = [];
- }
- $this->assign('select_html',$select_html);
-
- return $this->fetch('conf');
- }
-
- public function ajax_users_level_bout()
- {
- $UsersLevel = model('UsersLevel')->getList();
- $LevelCount = count($UsersLevel);
-
- $this->assign('list',$UsersLevel);
- $this->assign('LevelCount',$LevelCount);
- return $this->fetch();
- }
- }
|