admin/addon/aliapp/shop/controller/CreateApplet.php

42 lines
1.2 KiB
PHP

<?php
namespace addon\aliapp\shop\controller;
use app\shop\controller\BaseShop;
use addon\aliapp\model\CreateApplet as createAppletModel;
use addon\aliapp\model\AliPayApplet;
class CreateApplet extends BaseShop{
public function __construct(){
parent::__construct();
// 输出菜单
if(request()->isGet()) $this->forthMenu();
}
/**
* Common: 添加小程序
* Author: wu-hui
* Time: 2022/12/28 18:16
* @return mixed
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function index(){
$createAppletModel = new createAppletModel();
if (request()->isAjax()) {
// 参数获取
$info = input('info',[]);
$res = $createAppletModel->setNewParams($info,$this->site_id);
return $res;
} else {
[$id,$content] = $createAppletModel->getNewParams($this->site_id);
$this->assign('id',$id);
$this->assign('info',$content);
return $this->fetch('aliapp/createApplet');
}
}
}