From 57bd1a697a053ae20b5a0ac97d23cf9d8d76b8bf Mon Sep 17 00:00:00 2001 From: lccsw <1127794702@qq.com> Date: Tue, 27 Jul 2021 10:37:52 +0800 Subject: [PATCH] add-admin-app_config --- admin/controllers/app/appusual/Config.php | 102 +---------- admin/controllers/app/liche/Main.php | 12 +- admin/controllers/app/licheb/Main.php | 10 +- admin/views/app/appusual/get_config.php | 208 +--------------------- admin/views/index.php | 4 +- api/controllers/wxapp/app/Config.php | 29 +++ api/controllers/wxapp/app/Payment.php | 3 +- api/controllers/wxapp/licheb/Xz.php | 112 ++++++++++++ www/admin/static/images/common/logo.png | Bin 0 -> 49164 bytes 9 files changed, 168 insertions(+), 312 deletions(-) create mode 100644 api/controllers/wxapp/app/Config.php create mode 100644 api/controllers/wxapp/licheb/Xz.php create mode 100644 www/admin/static/images/common/logo.png 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 @@
+
8~LhRBPLOO}?d~Yg@ha$3W#6r>3Jx|RDGFTP~1s}<0
zNG`Gq2JK{`Ew-cyimq!$Xvh_xDK=BXSs5k&C_5jnjei?wc>Lnss9jGs3x@IVot(>y
z27*EOL4LehET82M`%zr@sqdZ{XmX(q8uu=GeSe^pjcM oC%s@F=<2Ik~xQ1|c+EwzaiwgcC1=
zCs&e@DVkX0!kn!v_O9#`4{MsPcU^f;qATb;-@6SSfs*9Hg;y_cM_g>yfmn8F)GM3y
zo;j}-C`EK8V_2?bd2Oxx!EA&W-Ra(JM4ZOkk&eZIEZvJDUN-?t)kq(OE_q$(wjC){
z&4MRo`M9Ez^}cI1+L!Y6#VFxSueVvTudl@@%jYHMKD{#;b-=_zXKOhA
z-6g@r)yw#y;VrxNoyTKIQAskK+Lf55a$SPywoxoSqKU0tU7a7JhXgpSzHUU7)HT&r
zIhRE^UF0zw{y0FIHJ26fn1kvvWtA_pwaxqoYUAnf=$ky5?;Bn=@OV-iJ@*LSE1;LH
zlpVZ^7tb0c`kvsue)MTJ?Mnko32j3QLsi39vW(g+-g?B^FPauz9hKHcXY4$4?<<7L
zcYTP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