123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- <?php
-
-
- namespace weapp\Baidushoulu\controller;
-
- use think\Db;
- use app\common\controller\Weapp;
- use weapp\Baidushoulu\model\BaidushouluModel;
-
-
- class Baidushoulu extends Weapp
- {
-
-
- private $model;
-
-
-
- private $weappInfo;
-
-
-
- public function __construct(){
- parent::__construct();
- $this->model = new BaidushouluModel;
-
-
- $this->weappInfo = $this->getWeappInfo();
- $this->assign('weappInfo', $this->weappInfo);
-
- }
-
-
-
-
-
- public function show($params = null)
- {
- $seo_pseudo = tpCache('seo.seo_pseudo');
- if ($seo_pseudo == 1) {
- $seo = '&';
- }
- if ($seo_pseudo == 2) {
- $seo = '?';
- }
- if ($seo_pseudo == 3) {
- $seo = '?';
- }
- $this->assign('seo', $seo);
- $baidushoulu = $this->model->getWeappData();
- $this->assign('baidushoulu', $baidushoulu);
- echo $this->fetch('show');
- }
-
-
- public function index()
- {
- $baidushoulu = $this->model->getWeappData();
- $this->assign('baidushoulu', $baidushoulu);
- return $this->fetch('index');
- }
-
-
-
- public function save()
- {
- if (IS_POST) {
- $data = I('post.');
- if (!empty($data['code'])) {
- $saveData = array(
- 'data' => serialize($data),
- 'tag_weapp' => $data['tag_weapp'],
- 'update_time' => getTime(),
- );
- $r = Db::name('weapp')->where(array('code' => $data['code']))->update($saveData);
- if ($r) {
- adminLog('编辑' . $this->weappInfo['name'] . '成功');
- $this->success("操作成功!", weapp_url('Baidushoulu/Baidushoulu/index'));
- }
- }
- }
- $this->error("操作失败");
- }
- }
|