diff --git a/application/admin/controller/Answer.php b/application/admin/controller/Answer.php index 7730a980f..ace23c7fd 100755 --- a/application/admin/controller/Answer.php +++ b/application/admin/controller/Answer.php @@ -49,48 +49,69 @@ class Answer extends Common */ public function Index() { - // 参数 - $params = input(); + // 总数 + $total = AnswerService::AnswerTotal($this->form_where); // 分页 - $number = MyC('admin_page_number', 10, true); - - // 条件 - $where = AnswerService::AnswerListWhere($params); - - // 获取总数 - $total = AnswerService::AnswerTotal($where); - - // 分页 - $page_params = array( - 'number' => $number, - 'total' => $total, - 'where' => $params, - 'page' => isset($params['page']) ? intval($params['page']) : 1, - 'url' => MyUrl('admin/answer/index'), - ); + $page_params = [ + 'number' => $this->page_size, + 'total' => $total, + 'where' => $this->data_request, + 'page' => $this->page, + 'url' => MyUrl('admin/answer/index'), + ]; $page = new \base\Page($page_params); - $this->assign('page_html', $page->GetPageHtml()); // 获取列表 - $data_params = array( - 'm' => $page->GetPageStarNumber(), - 'n' => $number, - 'where' => $where, - 'is_public' => 0, - ); - $data = AnswerService::AnswerList($data_params); - $this->assign('data_list', $data['data']); + $data_params = [ + 'where' => $this->form_where, + 'm' => $page->GetPageStarNumber(), + 'n' => $this->page_size, + 'is_public' => 0, + ]; + $ret = AnswerService::AnswerList($data_params); // 静态数据 $this->assign('common_is_show_list', lang('common_is_show_list')); $this->assign('common_is_text_list', lang('common_is_text_list')); - // 参数 - $this->assign('params', $params); + // 基础参数赋值 + $this->assign('params', $this->data_request); + $this->assign('page_html', $page->GetPageHtml()); + $this->assign('data_list', $ret['data']); return $this->fetch(); } + /** + * 详情 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @datetime 2019-08-05T08:21:54+0800 + */ + public function Detail() + { + if(!empty($this->data_request['id'])) + { + // 条件 + $where = [ + ['id', '=', intval($this->data_request['id'])], + ]; + + // 获取列表 + $data_params = [ + 'm' => 0, + 'n' => 1, + 'where' => $where, + 'is_public' => 0, + ]; + $ret = AnswerService::AnswerList($data_params); + $data = (empty($ret['data']) || empty($ret['data'][0])) ? [] : $ret['data'][0]; + $this->assign('data', $data); + } + return $this->fetch(); + } + /** * [SaveInfo 添加/编辑页面] * @author Devil @@ -101,7 +122,7 @@ class Answer extends Common public function SaveInfo() { // 参数 - $params = input(); + $params = $this->data_request; // 数据 $data = []; @@ -160,7 +181,7 @@ class Answer extends Common } // 开始处理 - $params = input(); + $params = $this->data_request; return AnswerService::AnswerSave($params); } @@ -180,7 +201,7 @@ class Answer extends Common } // 开始处理 - $params = input(); + $params = $this->data_request; $params['user_type'] = 'admin'; return AnswerService::AnswerDelete($params); } @@ -201,7 +222,7 @@ class Answer extends Common } // 开始处理 - $params = input(); + $params = $this->data_request; return AnswerService::AnswerReply($params); } @@ -221,7 +242,7 @@ class Answer extends Common } // 开始处理 - $params = input(); + $params = $this->data_request; return AnswerService::AnswerStatusUpdate($params); } } diff --git a/application/admin/controller/Appminialipaylist.php b/application/admin/controller/Appminialipaylist.php index 65bb4f901..57ec5535d 100755 --- a/application/admin/controller/Appminialipaylist.php +++ b/application/admin/controller/Appminialipaylist.php @@ -45,7 +45,7 @@ class AppMiniAlipayList extends Common $this->IsPower(); // 参数 - $this->params = input(); + $this->params = $this->data_request; $this->params['application_name'] = 'alipay'; } @@ -58,7 +58,8 @@ class AppMiniAlipayList extends Common */ public function Index() { - $this->assign('data_list', AppMiniService::DataList($this->params)); + $ret = AppMiniService::DataList($this->params); + $this->assign('data_list', $ret['data']); return $this->fetch(); } diff --git a/application/admin/controller/Appminibaidulist.php b/application/admin/controller/Appminibaidulist.php index 29d55ee46..ebe97e712 100755 --- a/application/admin/controller/Appminibaidulist.php +++ b/application/admin/controller/Appminibaidulist.php @@ -45,7 +45,7 @@ class AppMiniBaiduList extends Common $this->IsPower(); // 参数 - $this->params = input(); + $this->params = $this->data_request; $this->params['application_name'] = 'baidu'; } @@ -58,7 +58,8 @@ class AppMiniBaiduList extends Common */ public function Index() { - $this->assign('data_list', AppMiniService::DataList($this->params)); + $ret = AppMiniService::DataList($this->params); + $this->assign('data_list', $ret['data']); return $this->fetch(); } diff --git a/application/admin/controller/Appminiqqlist.php b/application/admin/controller/Appminiqqlist.php index d469093d7..53c0a2914 100755 --- a/application/admin/controller/Appminiqqlist.php +++ b/application/admin/controller/Appminiqqlist.php @@ -45,7 +45,7 @@ class AppMiniQQList extends Common $this->IsPower(); // 参数 - $this->params = input(); + $this->params = $this->data_request; $this->params['application_name'] = 'qq'; } @@ -58,7 +58,8 @@ class AppMiniQQList extends Common */ public function Index() { - $this->assign('data_list', AppMiniService::DataList($this->params)); + $ret = AppMiniService::DataList($this->params); + $this->assign('data_list', $ret['data']); return $this->fetch(); } diff --git a/application/admin/controller/Appminitoutiaolist.php b/application/admin/controller/Appminitoutiaolist.php index 5dbad3d82..eca9b3c68 100755 --- a/application/admin/controller/Appminitoutiaolist.php +++ b/application/admin/controller/Appminitoutiaolist.php @@ -45,7 +45,7 @@ class AppMiniToutiaoList extends Common $this->IsPower(); // 参数 - $this->params = input(); + $this->params = $this->data_request; $this->params['application_name'] = 'toutiao'; } @@ -58,7 +58,8 @@ class AppMiniToutiaoList extends Common */ public function Index() { - $this->assign('data_list', AppMiniService::DataList($this->params)); + $ret = AppMiniService::DataList($this->params); + $this->assign('data_list', $ret['data']); return $this->fetch(); } diff --git a/application/admin/controller/Appminiweixinlist.php b/application/admin/controller/Appminiweixinlist.php index cdc66b298..e835b7732 100755 --- a/application/admin/controller/Appminiweixinlist.php +++ b/application/admin/controller/Appminiweixinlist.php @@ -45,7 +45,7 @@ class AppMiniWeixinList extends Common $this->IsPower(); // 参数 - $this->params = input(); + $this->params = $this->data_request; $this->params['application_name'] = 'weixin'; } @@ -58,7 +58,8 @@ class AppMiniWeixinList extends Common */ public function Index() { - $this->assign('data_list', AppMiniService::DataList($this->params)); + $ret = AppMiniService::DataList($this->params); + $this->assign('data_list', $ret['data']); return $this->fetch(); } diff --git a/application/admin/form/Answer.php b/application/admin/form/Answer.php new file mode 100644 index 000000000..2f59560ec --- /dev/null +++ b/application/admin/form/Answer.php @@ -0,0 +1,237 @@ + [ + 'key_field' => 'id', + 'status_field' => 'is_show', + 'is_search' => 1, + 'search_url' => MyUrl('admin/answer/index'), + 'is_delete' => 1, + 'delete_url' => MyUrl('admin/answer/delete'), + 'delete_key' => 'ids', + ], + // 表单配置 + 'form' => [ + [ + 'view_type' => 'checkbox', + 'is_checked' => 0, + 'checked_text' => '反选', + 'not_checked_text' => '全选', + 'align' => 'center', + 'width' => 80, + ], + [ + 'label' => '用户信息', + 'view_type' => 'module', + 'view_key' => 'answer/module/user', + 'grid_size' => 'sm', + 'search_config' => [ + 'form_type' => 'input', + 'form_name' => 'user_id', + 'where_type' => 'like', + 'where_type_custom' => 'in', + 'where_handle_custom' => 'WhereValueUserInfo', + 'placeholder' => '请输入用户名/昵称/手机/邮箱', + ], + ], + [ + 'label' => '联系人', + 'view_type' => 'field', + 'view_key' => 'name', + 'search_config' => [ + 'form_type' => 'input', + 'where_type' => 'like', + ], + ], + [ + 'label' => '联系电话', + 'view_type' => 'field', + 'view_key' => 'tel', + 'search_config' => [ + 'form_type' => 'input', + 'where_type' => 'like', + ], + ], + [ + 'label' => '内容', + 'view_type' => 'module', + 'view_key' => 'answer/module/content', + 'grid_size' => 'lg', + 'search_config' => [ + 'form_type' => 'input', + 'form_name' => 'content', + 'where_type' => 'like', + ], + ], + [ + 'label' => '回复内容', + 'view_type' => 'module', + 'view_key' => 'answer/module/reply', + 'grid_size' => 'lg', + 'search_config' => [ + 'form_type' => 'input', + 'form_name' => 'reply', + 'where_type' => 'like', + ], + ], + [ + 'label' => '是否显示', + 'view_type' => 'status', + 'view_key' => 'is_show', + 'post_url' => MyUrl('admin/answer/statusupdate'), + 'is_form_su' => 1, + 'align' => 'center', + 'search_config' => [ + 'form_type' => 'select', + 'where_type' => 'in', + 'data' => lang('common_is_shelves_list'), + 'data_key' => 'id', + 'data_name' => 'name', + 'is_multiple' => 1, + ], + ], + [ + 'label' => '是否回复', + 'view_type' => 'status', + 'view_key' => 'is_reply', + 'post_url' => MyUrl('admin/answer/statusupdate'), + 'align' => 'center', + 'search_config' => [ + 'form_type' => 'select', + 'where_type' => 'in', + 'data' => lang('common_is_text_list'), + 'data_key' => 'id', + 'data_name' => 'name', + 'is_multiple' => 1, + ], + ], + [ + 'label' => '回复时间', + 'view_type' => 'field', + 'view_key' => 'reply_time_time', + 'search_config' => [ + 'form_type' => 'datetime', + 'form_name' => 'reply_time', + ], + ], + [ + 'label' => '访问次数', + 'view_type' => 'field', + 'view_key' => 'access_count', + 'search_config' => [ + 'form_type' => 'section', + ], + ], + [ + 'label' => '创建时间', + 'view_type' => 'field', + 'view_key' => 'add_time_time', + 'search_config' => [ + 'form_type' => 'datetime', + 'form_name' => 'add_time', + ], + ], + [ + 'label' => '更新时间', + 'view_type' => 'field', + 'view_key' => 'upd_time_time', + 'search_config' => [ + 'form_type' => 'datetime', + 'form_name' => 'upd_time', + ], + ], + [ + 'label' => '操作', + 'view_type' => 'operate', + 'view_key' => 'answer/module/operate', + 'align' => 'center', + 'fixed' => 'right', + ], + ], + ]; + } + + /** + * 用户信息条件处理 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2020-06-08 + * @desc description + * @param [string] $value [条件值] + * @param [array] $params [输入参数] + */ + public function WhereValueUserInfo($value, $params = []) + { + if(!empty($value)) + { + // 获取用户 id + $ids = Db::name('User')->where('username|nickname|mobile|email', 'like', '%'.$value.'%')->column('id'); + + // 避免空条件造成无效的错觉 + return empty($ids) ? [0] : $ids; + } + return $value; + } + + /** + * 基础信息条件处理 + * @author Devil + * @blog http://gong.gg/ + * @version 1.0.0 + * @date 2020-06-08 + * @desc description + * @param [string] $value [条件值] + * @param [array] $params [输入参数] + */ + public function WhereValueBaseInfo($value, $params = []) + { + if(!empty($value)) + { + // 获取商品评论关联的商品 id + $ids = Db::name('answer')->alias('gc')->join(['__GOODS__'=>'g'], 'gc.goods_id=g.id')->where('title|model', 'like', '%'.$value.'%')->column('gc.id'); + + // 避免空条件造成无效的错觉 + return empty($ids) ? [0] : $ids; + } + return $value; + } +} +?> \ No newline at end of file diff --git a/application/admin/form/Appminialipaylist.php b/application/admin/form/Appminialipaylist.php index b15c89c6f..d90c32ecf 100644 --- a/application/admin/form/Appminialipaylist.php +++ b/application/admin/form/Appminialipaylist.php @@ -15,7 +15,7 @@ namespace app\admin\form; * @author Devil * @blog http://gong.gg/ * @version 1.0.0 - * @date 2020-06-20 + * @date 2020-06-22 * @desc description */ class Appminialipaylist @@ -28,7 +28,7 @@ class Appminialipaylist * @author Devil * @blog http://gong.gg/ * @version 1.0.0 - * @date 2020-06-20 + * @date 2020-06-22 * @desc description * @param [array] $params [输入参数] */ @@ -37,7 +37,10 @@ class Appminialipaylist return [ // 基础配置 'base' => [ - 'key_field' => 'id', + 'key_field' => 'name', + 'is_delete' => 1, + 'delete_url' => MyUrl('admin/appminialipaylist/delete'), + 'delete_key' => 'ids', ], // 表单配置 'form' => [ @@ -50,115 +53,30 @@ class Appminialipaylist 'width' => 80, ], [ - 'label' => '名称', + 'label' => '包名', 'view_type' => 'field', 'view_key' => 'name', - 'search_config' => [ - 'form_type' => 'input', - 'where_type' => 'like', - ], ], [ - 'label' => '所属平台', + 'label' => '大小', 'view_type' => 'field', - 'view_key' => 'platform_text', - 'search_config' => [ - 'form_type' => 'select', - 'form_name' => 'platform', - 'where_type' => 'in', - 'data' => lang('common_platform_type'), - 'data_key' => 'value', - 'data_name' => 'name', - 'is_multiple' => 1, - ], + 'view_key' => 'size', ], [ - 'label' => '导航图标', - 'view_type' => 'module', - 'view_key' => 'appcenternav/module/images', - 'align' => 'center', - ], - [ - 'label' => '事件类型', + 'label' => '下载地址', 'view_type' => 'field', - 'view_key' => 'event_type_text', - 'grid_size' => 'sm', - 'search_config' => [ - 'form_type' => 'select', - 'form_name' => 'event_type', - 'where_type' => 'in', - 'data' => lang('common_app_event_type'), - 'data_key' => 'value', - 'data_name' => 'name', - 'is_multiple' => 1, - ], - ], - [ - 'label' => '事件值', - 'view_type' => 'field', - 'view_key' => 'event_value', - 'grid_size' => 'sm', - 'search_config' => [ - 'form_type' => 'input', - 'where_type' => 'like', - ], - ], - [ - 'label' => '是否启用', - 'view_type' => 'status', - 'view_key' => 'is_enable', - 'post_url' => MyUrl('admin/appcenternav/statusupdate'), - 'is_form_su' => 1, - 'align' => 'center', - 'search_config' => [ - 'form_type' => 'select', - 'where_type' => 'in', - 'data' => lang('common_is_enable_list'), - 'data_key' => 'id', - 'data_name' => 'name', - 'is_multiple' => 1, - ], - ], - [ - 'label' => '是否需登录', - 'view_type' => 'status', - 'view_key' => 'is_need_login', - 'post_url' => MyUrl('admin/appcenternav/statusupdate'), - 'align' => 'center', - 'search_config' => [ - 'form_type' => 'select', - 'where_type' => 'in', - 'data' => lang('common_is_text_list'), - 'data_key' => 'id', - 'data_name' => 'name', - 'is_multiple' => 1, - ], - ], - [ - 'label' => '排序', - 'view_type' => 'field', - 'view_key' => 'sort', + 'view_key' => 'url', + 'grid_size' => 'auto', ], [ 'label' => '创建时间', 'view_type' => 'field', - 'view_key' => 'add_time', - 'search_config' => [ - 'form_type' => 'datetime', - ], - ], - [ - 'label' => '更新时间', - 'view_type' => 'field', - 'view_key' => 'upd_time', - 'search_config' => [ - 'form_type' => 'datetime', - ], + 'view_key' => 'time', ], [ 'label' => '操作', 'view_type' => 'operate', - 'view_key' => 'appcenternav/module/operate', + 'view_key' => 'appminialipaylist/module/operate', 'align' => 'center', 'fixed' => 'right', ], diff --git a/application/admin/form/Appminibaidulist.php b/application/admin/form/Appminibaidulist.php new file mode 100644 index 000000000..d0d4ed991 --- /dev/null +++ b/application/admin/form/Appminibaidulist.php @@ -0,0 +1,87 @@ + [ + 'key_field' => 'name', + 'is_delete' => 1, + 'delete_url' => MyUrl('admin/appminibaidulist/delete'), + 'delete_key' => 'ids', + ], + // 表单配置 + 'form' => [ + [ + 'view_type' => 'checkbox', + 'is_checked' => 0, + 'checked_text' => '反选', + 'not_checked_text' => '全选', + 'align' => 'center', + 'width' => 80, + ], + [ + 'label' => '包名', + 'view_type' => 'field', + 'view_key' => 'name', + ], + [ + 'label' => '大小', + 'view_type' => 'field', + 'view_key' => 'size', + ], + [ + 'label' => '下载地址', + 'view_type' => 'field', + 'view_key' => 'url', + 'grid_size' => 'auto', + ], + [ + 'label' => '创建时间', + 'view_type' => 'field', + 'view_key' => 'time', + ], + [ + 'label' => '操作', + 'view_type' => 'operate', + 'view_key' => 'appminibaidulist/module/operate', + 'align' => 'center', + 'fixed' => 'right', + ], + ], + ]; + } +} +?> \ No newline at end of file diff --git a/application/admin/form/Appminiqqlist.php b/application/admin/form/Appminiqqlist.php new file mode 100644 index 000000000..2b96ee7b0 --- /dev/null +++ b/application/admin/form/Appminiqqlist.php @@ -0,0 +1,87 @@ + [ + 'key_field' => 'name', + 'is_delete' => 1, + 'delete_url' => MyUrl('admin/appminiqqlist/delete'), + 'delete_key' => 'ids', + ], + // 表单配置 + 'form' => [ + [ + 'view_type' => 'checkbox', + 'is_checked' => 0, + 'checked_text' => '反选', + 'not_checked_text' => '全选', + 'align' => 'center', + 'width' => 80, + ], + [ + 'label' => '包名', + 'view_type' => 'field', + 'view_key' => 'name', + ], + [ + 'label' => '大小', + 'view_type' => 'field', + 'view_key' => 'size', + ], + [ + 'label' => '下载地址', + 'view_type' => 'field', + 'view_key' => 'url', + 'grid_size' => 'auto', + ], + [ + 'label' => '创建时间', + 'view_type' => 'field', + 'view_key' => 'time', + ], + [ + 'label' => '操作', + 'view_type' => 'operate', + 'view_key' => 'appminiqqlist/module/operate', + 'align' => 'center', + 'fixed' => 'right', + ], + ], + ]; + } +} +?> \ No newline at end of file diff --git a/application/admin/form/Appminitoutiaolist.php b/application/admin/form/Appminitoutiaolist.php new file mode 100644 index 000000000..576128edf --- /dev/null +++ b/application/admin/form/Appminitoutiaolist.php @@ -0,0 +1,87 @@ + [ + 'key_field' => 'name', + 'is_delete' => 1, + 'delete_url' => MyUrl('admin/appminitoutiaolist/delete'), + 'delete_key' => 'ids', + ], + // 表单配置 + 'form' => [ + [ + 'view_type' => 'checkbox', + 'is_checked' => 0, + 'checked_text' => '反选', + 'not_checked_text' => '全选', + 'align' => 'center', + 'width' => 80, + ], + [ + 'label' => '包名', + 'view_type' => 'field', + 'view_key' => 'name', + ], + [ + 'label' => '大小', + 'view_type' => 'field', + 'view_key' => 'size', + ], + [ + 'label' => '下载地址', + 'view_type' => 'field', + 'view_key' => 'url', + 'grid_size' => 'auto', + ], + [ + 'label' => '创建时间', + 'view_type' => 'field', + 'view_key' => 'time', + ], + [ + 'label' => '操作', + 'view_type' => 'operate', + 'view_key' => 'appminitoutiaolist/module/operate', + 'align' => 'center', + 'fixed' => 'right', + ], + ], + ]; + } +} +?> \ No newline at end of file diff --git a/application/admin/form/Appminiweixinlist.php b/application/admin/form/Appminiweixinlist.php new file mode 100644 index 000000000..ce45c1c3b --- /dev/null +++ b/application/admin/form/Appminiweixinlist.php @@ -0,0 +1,87 @@ + [ + 'key_field' => 'name', + 'is_delete' => 1, + 'delete_url' => MyUrl('admin/appminiweixinlist/delete'), + 'delete_key' => 'ids', + ], + // 表单配置 + 'form' => [ + [ + 'view_type' => 'checkbox', + 'is_checked' => 0, + 'checked_text' => '反选', + 'not_checked_text' => '全选', + 'align' => 'center', + 'width' => 80, + ], + [ + 'label' => '包名', + 'view_type' => 'field', + 'view_key' => 'name', + ], + [ + 'label' => '大小', + 'view_type' => 'field', + 'view_key' => 'size', + ], + [ + 'label' => '下载地址', + 'view_type' => 'field', + 'view_key' => 'url', + 'grid_size' => 'auto', + ], + [ + 'label' => '创建时间', + 'view_type' => 'field', + 'view_key' => 'time', + ], + [ + 'label' => '操作', + 'view_type' => 'operate', + 'view_key' => 'appminiweixinlist/module/operate', + 'align' => 'center', + 'fixed' => 'right', + ], + ], + ]; + } +} +?> \ No newline at end of file diff --git a/application/admin/view/default/answer/index.html b/application/admin/view/default/answer/index.html index b168a68d6..2f5a6386c 100755 --- a/application/admin/view/default/answer/index.html +++ b/application/admin/view/default/answer/index.html @@ -1,366 +1,48 @@ -{{include file="public/header" /}} + +{{extend name="public/module/form" /}} - -