<?php
namespace app\store\controller;
use app\store\model\Wxapp as WxappModel;
use app\store\model\WxappNavbar as WxappNavbarModel;
class Wx extends Controller
{
public function setting()
{
$model = WxappModel::detail();
if (!$this->request->isAjax()) {
return $this->fetch('setting', compact('model'));
}
if ($model->edit($this->postData('wxapp'))) {
return $this->renderSuccess('更新成功');
}
return $this->renderError($model->getError() ?: '更新失败');
}
public function tabbar()
{
$model = WxappNavbarModel::detail();
if (!$this->request->isAjax()) {
return $this->fetch('tabbar', compact('model'));
}
$data = $this->postData('tabbar');
if (!$model->edit($data)) {
return $this->renderError('更新失败');
}
return $this->renderSuccess('更新成功');
}
}