From dce0f0c1f9e5f8f6b56f9a24986cb8ca9b0be776 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=AF=E7=AB=8B?= Date: Thu, 13 Apr 2017 15:00:34 +0800 Subject: [PATCH] =?UTF-8?q?[=E6=9B=B4=E6=96=B0]=E4=BF=AE=E6=94=B9=E5=BE=AE?= =?UTF-8?q?=E4=BF=A1=E9=85=8D=E7=BD=AE=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/admin/controller/Auth.php | 2 +- application/wechat/view/config.index.html | 14 ++-- application/wechat/view/config.pay.html | 2 +- extend/controller/BasicAdmin.php | 80 +++++++++++------------ 4 files changed, 52 insertions(+), 46 deletions(-) diff --git a/application/admin/controller/Auth.php b/application/admin/controller/Auth.php index fd882dfea..827b21465 100644 --- a/application/admin/controller/Auth.php +++ b/application/admin/controller/Auth.php @@ -105,7 +105,7 @@ class Auth extends BasicAdmin { * 权限编辑 */ public function edit() { - return $this->add(); + return $this->_form($this->table, 'form'); } /** diff --git a/application/wechat/view/config.index.html b/application/wechat/view/config.index.html index f856bb4d8..180f98e75 100644 --- a/application/wechat/view/config.index.html +++ b/application/wechat/view/config.index.html @@ -10,7 +10,8 @@

- 注意:服务器域名必需备案,微信官方只支持80端口和443端口。 + 请复制此URL地址填写在公众号平台 [ 开发 >> 基本配置 ] 中 [ URL ( 服务器地址 ) ] +
注意:URL主域名必需备案,微信服务接口只支持 80 端口 ( http ) 和 443 端口 ( https ).

@@ -20,8 +21,12 @@
- +

+ 公众号应用ID是所有接口必要参数,可以从公众号平台接口配置页面获取到。 +

@@ -30,11 +35,12 @@
-

- 公众号平台与系统对接认证Token,请优先填写此参数并保存,然后再在微信公众号平台操作对接。 + 公众号应用密钥是所有接口必要参数,可以在公众号平台 [ 开发 >> 基本配置 ] 页面授权后获取。

diff --git a/application/wechat/view/config.pay.html b/application/wechat/view/config.pay.html index 71f046ab1..a3c17c74b 100644 --- a/application/wechat/view/config.pay.html +++ b/application/wechat/view/config.pay.html @@ -5,7 +5,7 @@ class='form-horizontal' style='padding-top:20px'>
- +
table); + } elseif (is_string($db)) { + $db = Db::name($db); + } + if (is_null($pk)) { + $pk = $db->getPk(); + } + $pk_value = input($pk, isset($where[$pk]) ? $where[$pk] : (isset($data[$pk]) ? $data[$pk] : '')); + $vo = $data; + if ($this->request->isPost()) { // Save Options + $vo = array_merge(input('post.'), $data); + $this->_callback('_form_filter', $vo); + $result = DataService::save($db, $vo, $pk, $where); + if (false !== $this->_callback('_form_result', $result)) { + $result !== false ? $this->success('恭喜,保存成功哦!', '') : $this->error('保存失败,请稍候再试!'); + } + return $result; + } + if ($pk_value !== '') { // Edit Options + !empty($pk_value) && $db->where($pk, $pk_value); + !empty($where) && $db->where($where); + $vo = array_merge($data, (array)$db->find()); + } + $this->_callback('_form_filter', $vo); + $this->assign('vo', $vo); + empty($this->title) or $this->assign('title', $this->title); + return is_null($tpl) ? $vo : $this->fetch($tpl); + } + /** * 列表集成处理方法 * @param Query $db 数据库查询对象 @@ -135,46 +175,6 @@ class BasicAdmin extends Controller { return $result; } - /** - * 表单默认操作 - * @param Query $db 数据库查询对象 - * @param string $tpl 显示模板名字 - * @param string $pk 更新主键规则 - * @param array $where 查询规则 - * @param array $data 扩展数据 - * @return array|string - */ - protected function _form($db = null, $tpl = null, $pk = null, $where = [], $data = []) { - if (is_null($db)) { - $db = Db::name($this->table); - } elseif (is_string($db)) { - $db = Db::name($db); - } - if (is_null($pk)) { - $pk = $db->getPk(); - } - $pk_value = input($pk, isset($where[$pk]) ? $where[$pk] : (isset($data[$pk]) ? $data[$pk] : '')); - $vo = $data; - if ($this->request->isPost()) { // Save Options - $vo = array_merge(input('post.'), $data); - $this->_callback('_form_filter', $vo); - $result = DataService::save($db, $vo, $pk, $where); - if (false !== $this->_callback('_form_result', $result)) { - $result !== false ? $this->success('恭喜,保存成功哦!', '') : $this->error('保存失败,请稍候再试!'); - } - return $result; - } - if ($pk_value !== '') { // Edit Options - !empty($pk_value) && $db->where($pk, $pk_value); - !empty($where) && $db->where($where); - $vo = array_merge($data, (array)$db->find()); - } - $this->_callback('_form_filter', $vo); - $this->assign('vo', $vo); - empty($this->title) or $this->assign('title', $this->title); - return is_null($tpl) ? $vo : $this->fetch($tpl); - } - /** * 当前对象回调成员方法 * @param string $method