<?php
namespace app\store\controller\wxapp;
use app\store\controller\Controller;
use app\store\model\Setting as SettingModel;
use app\store\service\wxapp\SubMsg as SubMsgService;
class Submsg extends Controller
{
public function index()
{
if (!$this->request->isAjax()) {
$values = SettingModel::getItem('submsg');
return $this->fetch('index', compact('values'));
}
$model = new SettingModel;
if ($model->edit('submsg', $this->postData('submsg'))) {
return $this->renderSuccess('操作成功');
}
return $this->renderError($model->getError() ?: '操作失败');
}
public function shuttle()
{
$SubMsgService = new SubMsgService;
if ($SubMsgService->shuttle()) {
return $this->renderSuccess('操作成功');
}
return $this->renderError($SubMsgService->getError() ?: '操作失败');
}
}