其余文件
This commit is contained in:
23
app/admin/controller/wechat/Hfive.php
Normal file
23
app/admin/controller/wechat/Hfive.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
namespace app\admin\controller\wechat;
|
||||
|
||||
use app\common\basics\AdminBase;
|
||||
use app\admin\logic\wechat\HfiveLogic;
|
||||
use app\common\server\JsonServer;
|
||||
|
||||
class Hfive extends AdminBase
|
||||
{
|
||||
/**
|
||||
* H5商城设置
|
||||
*/
|
||||
public function set()
|
||||
{
|
||||
if($this->request->isPost()) {
|
||||
$params = $this->request->post();
|
||||
HfiveLogic::set($params);
|
||||
return JsonServer::success('设置成功');
|
||||
}
|
||||
$config = HfiveLogic::getConfig();
|
||||
return view('set', ['config' => $config]);
|
||||
}
|
||||
}
|
||||
60
app/admin/controller/wechat/Mnp.php
Normal file
60
app/admin/controller/wechat/Mnp.php
Normal file
@ -0,0 +1,60 @@
|
||||
<?php
|
||||
namespace app\admin\controller\wechat;
|
||||
|
||||
use app\common\basics\AdminBase;
|
||||
use app\admin\logic\wechat\MnpLogic;
|
||||
use app\common\server\JsonServer;
|
||||
use app\common\server\ConfigServer;
|
||||
|
||||
class Mnp extends AdminBase
|
||||
{
|
||||
/**
|
||||
* 小程序设置
|
||||
*/
|
||||
public function setMnp()
|
||||
{
|
||||
if($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
if(isset($post['qr_code'])){
|
||||
$domain = $this->request->domain();
|
||||
$post['qr_code'] = str_replace($domain, '', $post['qr_code']);
|
||||
}else{
|
||||
$post['qr_code'] = '';
|
||||
}
|
||||
MnpLogic::setMnp($post);
|
||||
return JsonServer::success('设置成功');
|
||||
}
|
||||
|
||||
$mnp = MnpLogic::getMnp();
|
||||
return view('set_mnp', ['mnp' => $mnp]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 一键上传
|
||||
*/
|
||||
public function uploadMnp()
|
||||
{
|
||||
if($this->request->isAjax()) {
|
||||
$post = $this->request->post();
|
||||
$post['admin_id'] = $this->adminId;
|
||||
$result = MnpLogic::uploadMnp($post);
|
||||
if (true !== $result) {
|
||||
return JsonServer::error($result);
|
||||
}
|
||||
return JsonServer::success('上传成功');
|
||||
}
|
||||
|
||||
return view('upload_mnp', ['version'=>config('project.version')]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传日志
|
||||
*/
|
||||
public function uploadMnpLog()
|
||||
{
|
||||
$get = $this->request->get();
|
||||
return JsonServer::success('', MnpLogic::uploadMnpLog($get));
|
||||
}
|
||||
}
|
||||
55
app/admin/controller/wechat/Oa.php
Normal file
55
app/admin/controller/wechat/Oa.php
Normal file
@ -0,0 +1,55 @@
|
||||
<?php
|
||||
namespace app\admin\controller\wechat;
|
||||
|
||||
use app\common\basics\AdminBase;
|
||||
use app\admin\logic\wechat\OaLogic;
|
||||
use app\common\server\JsonServer;
|
||||
use app\common\server\ConfigServer;
|
||||
|
||||
class Oa extends AdminBase
|
||||
{
|
||||
/**
|
||||
* 公众号设置
|
||||
*/
|
||||
public function setOa()
|
||||
{
|
||||
if($this->request->isAjax()){
|
||||
$post = $this->request->post();
|
||||
if(isset($post['qr_code']) && !empty($post['qr_code'])) {
|
||||
$domain = $this->request->domain();
|
||||
$post['qr_code'] = str_replace($domain, '', $post['qr_code']);
|
||||
}else{
|
||||
$post['qr_code'] = '';
|
||||
}
|
||||
OaLogic::setOa($post);
|
||||
return JsonServer::success('设置成功');
|
||||
}
|
||||
$oa = OaLogic::getOa();
|
||||
return view('setoa', ['oa' => $oa]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 菜单管理
|
||||
*/
|
||||
public function oaMenu()
|
||||
{
|
||||
$wechat_menu = ConfigServer::get('menu', 'wechat_menu',[]);
|
||||
return view('oamenu', ['menu' => $wechat_menu]);
|
||||
}
|
||||
|
||||
/**
|
||||
* 发布菜单
|
||||
*/
|
||||
public function pulishMenu()
|
||||
{
|
||||
$menu = $this->request->post('button');
|
||||
if(empty($menu)){
|
||||
return JsonServer::error('请设置菜单');
|
||||
}
|
||||
$result = OaLogic::pulishMenu($menu);
|
||||
if($result){
|
||||
return JsonServer::success('菜单发布成功');
|
||||
}
|
||||
return JsonServer::error(OaLogic::getError());
|
||||
}
|
||||
}
|
||||
26
app/admin/controller/wechat/Op.php
Normal file
26
app/admin/controller/wechat/Op.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?php
|
||||
namespace app\admin\controller\wechat;
|
||||
|
||||
use app\common\basics\AdminBase;
|
||||
use app\admin\logic\wechat\OpLogic;
|
||||
use app\common\server\JsonServer;
|
||||
|
||||
class Op extends AdminBase
|
||||
{
|
||||
/**
|
||||
* 开放平台配置
|
||||
*/
|
||||
public function config()
|
||||
{
|
||||
if($this->request->isAjax()){
|
||||
$post = $this->request->post();
|
||||
OpLogic::setConfig($post);
|
||||
return JsonServer::success('设置成功');
|
||||
}
|
||||
|
||||
return view('config', [
|
||||
'config' => OpLogic::getConfig(['app_id','secret']), //微信公众开放平台-APP应用
|
||||
'web_config' => OpLogic::getConfig(['web_app_id','web_secret']) //微信公众开放平台-网站应用
|
||||
]);
|
||||
}
|
||||
}
|
||||
23
app/admin/controller/wechat/Pc.php
Normal file
23
app/admin/controller/wechat/Pc.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
namespace app\admin\controller\wechat;
|
||||
|
||||
use app\admin\logic\wechat\PcLogic;
|
||||
use app\common\basics\AdminBase;
|
||||
use app\common\server\JsonServer;
|
||||
|
||||
class Pc extends AdminBase
|
||||
{
|
||||
/**
|
||||
* PC商城设置
|
||||
*/
|
||||
public function set()
|
||||
{
|
||||
if($this->request->isPost()) {
|
||||
$params = $this->request->post();
|
||||
PcLogic::set($params);
|
||||
return JsonServer::success('设置成功');
|
||||
}
|
||||
$config = PcLogic::getConfig();
|
||||
return view('set', ['config' => $config]);
|
||||
}
|
||||
}
|
||||
99
app/admin/controller/wechat/Reply.php
Normal file
99
app/admin/controller/wechat/Reply.php
Normal file
@ -0,0 +1,99 @@
|
||||
<?php
|
||||
namespace app\admin\controller\wechat;
|
||||
|
||||
use app\common\basics\AdminBase;
|
||||
use app\admin\logic\wechat\ReplyLogic;
|
||||
use app\common\server\JsonServer;
|
||||
use app\common\server\ConfigServer;
|
||||
use app\common\model\wechat\Wechat;
|
||||
use app\admin\validate\wechat\ReplyValidate;
|
||||
|
||||
class Reply extends AdminBase
|
||||
{
|
||||
public function lists(){
|
||||
if($this->request->isAjax()){
|
||||
$get = $this->request->get();
|
||||
$data = ReplyLogic::lists($get);
|
||||
return JsonServer::success('', $data);
|
||||
}
|
||||
|
||||
$type_list= Wechat::getCustomReply();
|
||||
return view('lists', ['type_list' => $type_list]);
|
||||
}
|
||||
|
||||
public function add()
|
||||
{
|
||||
if($this->request->isAjax()){
|
||||
try{
|
||||
$post = $this->request->post();
|
||||
validate(ReplyValidate::class)->scene($post['reply_type'])->check($post);
|
||||
}catch(\think\exception\ValidateException $e) {
|
||||
return JsonServer::error($e->getError());
|
||||
}
|
||||
$result= ReplyLogic::add($post);
|
||||
if($result) {
|
||||
return JsonServer::success('新增成功');
|
||||
}else{
|
||||
return JsonServer::error('新增失败');
|
||||
}
|
||||
}
|
||||
|
||||
$type = $this->request->get('type');
|
||||
$template = 'add_'.$type;
|
||||
return view($template);
|
||||
}
|
||||
|
||||
public function edit()
|
||||
{
|
||||
if($this->request->isAjax()){
|
||||
try{
|
||||
$post = $this->request->post();
|
||||
validate(ReplyValidate::class)->scene($post['reply_type'])->check($post);
|
||||
}catch(\think\exception\ValidateException $e) {
|
||||
return JsonServer::error($e->getError());
|
||||
}
|
||||
$result= ReplyLogic::edit($post);
|
||||
if($result) {
|
||||
return JsonServer::success('编辑成功');
|
||||
}else{
|
||||
return JsonServer::error('编辑失败');
|
||||
}
|
||||
}
|
||||
|
||||
$id = $this->request->get('id');
|
||||
$detail = ReplyLogic::getReply($id);
|
||||
$template = 'edit_'.$detail['reply_type'];
|
||||
return view($template, ['detail' => $detail]);
|
||||
}
|
||||
|
||||
public function del(){
|
||||
if($this->request->isPost()) {
|
||||
try{
|
||||
$post = $this->request->post();
|
||||
validate(ReplyValidate::class)->scene('del')->check($post);
|
||||
}catch(\think\exception\ValidateException $e) {
|
||||
return JsonServer::error($e->getError());
|
||||
}
|
||||
$result = ReplyLogic::del($post['id']);
|
||||
if($result) {
|
||||
return JsonServer::success('删除成功');
|
||||
}else{
|
||||
return JsonServer::error('删除失败');
|
||||
}
|
||||
}else{
|
||||
return JsonServer::error('请求类型错误');
|
||||
}
|
||||
}
|
||||
|
||||
public function changeFields(){
|
||||
$pk_value = $this->request->post('id');
|
||||
$field = $this->request->post('field');
|
||||
$field_value = $this->request->post('value');
|
||||
$reply_type = $this->request->post('reply_type');
|
||||
$result = ReplyLogic::changeFields($pk_value, $field, $field_value,$reply_type);
|
||||
if ($result) {
|
||||
return JsonServer::success('修改成功');
|
||||
}
|
||||
return JsonServer::error('修改失败');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user