1 line
1.5 KiB
PHP
1 line
1.5 KiB
PHP
<?php
|
|
namespace app\api\controller\food;
|
|
|
|
use app\api\controller\food\Controller;
|
|
use app\api\model\food\Page as PageModel;
|
|
use app\api\model\food\Setting;
|
|
use app\api\model\Setting as SettingModel;
|
|
use app\api\model\Applet as AppletModel;
|
|
|
|
/**
|
|
* 小程序
|
|
*/
|
|
class Applet extends Controller
|
|
{
|
|
/**
|
|
* 小程序基础信息
|
|
*/
|
|
public function base()
|
|
{
|
|
$applet = AppletModel::get($this->applet_id);
|
|
$page = PageModel::getHome()['page_data']['array']; //获取DIY页面数据
|
|
$applet['navbar'] = $page['page'];
|
|
$applet['tabbar'] = $page['tabbar'];
|
|
$applet['other'] = Setting::getItem('other');
|
|
$applet['copyright'] = '';
|
|
if($food = get_addons_config('food')){
|
|
$applet['copyright'] = $food['copyright'];
|
|
}
|
|
if($this->mp == 'weixin'){
|
|
$applet['helper_appid'] = '';
|
|
if($helper = get_addons_config('foodhelp')){
|
|
$applet['helper_appid'] = $helper['app_id'];
|
|
}
|
|
}
|
|
if($this->mp == 'alipay'){
|
|
$config = SettingModel::getItem('alipayopen',0);
|
|
$applet['component_appid'] = $config['app_id'];//第三方应用ID
|
|
}
|
|
return $this->renderSuccess(compact('applet'));
|
|
|
|
}
|
|
|
|
/**
|
|
* 用户中心配置
|
|
*/
|
|
public function center()
|
|
{
|
|
$value = Setting::getItem('center');//用户中心配置
|
|
$value['menu'] = array_sort($value['menu'],'sort');
|
|
return $this->renderSuccess($value);
|
|
}
|
|
}
|
|
|