diff --git a/admin/controllers/app/appusual/Config.php b/admin/controllers/app/appusual/Config.php index 4e95590a..68969613 100644 --- a/admin/controllers/app/appusual/Config.php +++ b/admin/controllers/app/appusual/Config.php @@ -10,7 +10,6 @@ class Config extends Appconf parent::__construct(); $this->load->model('app/app_model'); $this->load->model("app/appusual/app_config_model"); - $this->load->model('vipcard/Vipcard_rights_model', 'rightsM'); } //首页信息 @@ -29,8 +28,6 @@ class Config extends Appconf public function get() { $id = $this->input->get('app_id'); - $this->load->model('app/app_model'); - $this->load->model("sys/sys_city_model", 'city_model'); $app = $this->app_model->get(array('id' => $id)); if (!$app) { @@ -39,23 +36,6 @@ class Config extends Appconf $json = $app['jsondata'] ? json_decode($app['jsondata'], true) : array(); $json['id'] = $id; $json['name'] = $app['name']; - $where = array('status' => 1); - $total = $this->city_model->count($where); - $citys = array(); - if ($total) { - $rows = $this->city_model->select($where, 'id DESC', 1, 20, 'city_id,name,firstchar'); - foreach ($rows as $item) { - $status = intval($json['citys'][$item['city_id']]); - $citys[] = array( - 'city_id' => $item['city_id'], - 'firstchar' => $item['firstchar'], - 'name' => $item['name'], - 'status' => $status, - 'statusion' => $status ? '开启' : '关闭', - 'default_city_id' => $json['city_id'] == $item['city_id'] ? 1 : 0, - ); - } - } $where = array('app_id' => $id); $select = "k,v"; @@ -68,11 +48,8 @@ class Config extends Appconf } $json[$k] = $v; } - - $this->data['type_arr'] = self::$rights_type; - $this->data['coup_arr'] = self::$coupon_type; + $this->data['info'] = $json; - $this->data['citys'] = $citys; $this->data['_title'] = "{$app['name']}-基础设置"; return $this->show_view('/app/appusual/get_config', true); } @@ -83,47 +60,6 @@ class Config extends Appconf } - public function edit_city() - { - if (!$this->if_ajax) { - return $this->show_json(SYS_CODE_FAIL, '提交出错!'); - } - - $id = $this->input->post('id'); - $city = $this->input->post('city'); - $status = $this->input->post('status'); - $type = $this->input->post('type'); - - $this->load->model('app/app_model'); - - $app = $this->app_model->get(array('id' => $id)); - if (!$app) { - return $this->show_json(SYS_CODE_FAIL, "id为{$id}小程序不存在"); - } - $json = $app['jsondata'] ? json_decode($app['jsondata'], true) : array(); - if ($type == 1) { - if ($status) { - $json['city_id'] = $city; - } else { - $json['city_id'] = 0; - } - } else { - if ($status) { - !$json['citys'][$city] && $json['citys'][$city] = 1; - } else { - unset($json['citys'][$city]); - if (!$json['citys']) { - unset($json['citys']); - } - } - } - $ret = $this->app_model->update(array('jsondata' => json_encode($json)), array('id' => $id)); - if (!$ret) { - debug_log("[error]" . __FUNCTION__ . ":" . $this->app_model->db->last_query(), $this->log_file); - return $this->show_json(SYS_CODE_FAIL, '操作失败'); - } - return $this->show_json(SYS_CODE_SUCCESS, '操作成功'); - } //编辑单条数据 public function edit() @@ -138,18 +74,9 @@ class Config extends Appconf } $json = json_decode($app['jsondata'], true); //是否开启自定义店铺分类 - $json_k = array('biz_cate', 'vipcard', 'rights', 'coupons', 'ebiz', 'publish', 'lock_fans', "rpackets"); + $json_k = array('publish'); foreach ($json_k as $k) { switch($k){ - case 'rights': - case 'coupons': - case 'rpackets': - if($input[$k] && is_array($input[$k])){ - $json[$k] = $input[$k]; - } else { - unset($json[$k]); - } - break; default: if ($input[$k]) { $json[$k] = $input[$k]; @@ -160,29 +87,6 @@ class Config extends Appconf } $this->app_model->update(array('jsondata' => json_encode($json, JSON_UNESCAPED_UNICODE)), array('id' => $input['id'])); - $config_k = array('hotword'); - foreach($config_k as $k){ - $where = array('app_id' => $input['id'], 'k' => $k); - $row_config = $this->app_config_model->get($where); - if($input[$k]){ - if($row_config){ - $upd = array("v" => json_encode($input[$k], JSON_UNESCAPED_UNICODE)); - $ret = $this->app_config_model->update($upd, array('id' => $row_config['id'])); - } else { - $add = array( - 'app_id' => $input['id'], - 'k' => $k, - 'v' => json_encode($input[$k], JSON_UNESCAPED_UNICODE), - 'admin_id' => $this->uid, - 'c_time' => time() - ); - $ret = $this->app_config_model->add($add); - } - } elseif($row_config) { - $ret = $this->app_config_model->delete(array('id' => $row_config['id'])); - } - } - return $this->show_json(SYS_CODE_SUCCESS, '操作成功'); } @@ -203,4 +107,4 @@ class Config extends Appconf { } -} \ No newline at end of file +} diff --git a/admin/controllers/app/liche/Main.php b/admin/controllers/app/liche/Main.php index 17227cc3..6b2559fc 100644 --- a/admin/controllers/app/liche/Main.php +++ b/admin/controllers/app/liche/Main.php @@ -24,6 +24,15 @@ class Main extends HD_Controller{ /*小程序设置 start*/ $list = array(); + $list[] = array( + 'title' => '基础设置', + 'btns' => array( + array('name' => '查看详情', 'url' => '/app/appusual/config/get?app_id=' . $this->app_id), + ), + ); + $conditions[] = array('icon' => 'am-icon-home', 'list' => $list); + + $list = []; // 用户数据 $value = $this->userM->count([]); $list[] = array( @@ -33,9 +42,6 @@ class Main extends HD_Controller{ array('name' => '查看详情', 'url' => '/app/liche/member/index'), ), ); - $conditions[] = array('icon' => 'am-icon-home', 'list' => $list); - - $list = []; $value = $this->subM->count(array('app_id' => $this->app_id)); $list[] = array( 'title' => '话题管理', diff --git a/admin/controllers/app/licheb/Main.php b/admin/controllers/app/licheb/Main.php index 7566f753..91fa2a1e 100644 --- a/admin/controllers/app/licheb/Main.php +++ b/admin/controllers/app/licheb/Main.php @@ -21,8 +21,16 @@ class Main extends HD_Controller{ $conditions = array(); /*小程序设置 start*/ - $list = array(); + $list = []; + $list[] = array( + 'title' => '基础设置', + 'btns' => array( + array('name' => '查看详情', 'url' => '/app/appusual/config/get?app_id=' . $this->app_id), + ), + ); + $conditions[] = array('icon' => 'am-icon-home', 'list' => $list); // 用户数据 + $list = []; $value = $this->userM->count([]); $list[] = array( 'title' => '用户(人)', diff --git a/admin/views/app/appusual/get_config.php b/admin/views/app/appusual/get_config.php index 1e10e5c8..31b1b1b8 100644 --- a/admin/views/app/appusual/get_config.php +++ b/admin/views/app/appusual/get_config.php @@ -17,18 +17,6 @@
\ No newline at end of file + diff --git a/admin/views/index.php b/admin/views/index.php index 8a18cc7c..215f7576 100755 --- a/admin/views/index.php +++ b/admin/views/index.php @@ -38,7 +38,9 @@
+