1.提交缺失的东西
This commit is contained in:
@ -27,7 +27,12 @@ class MenuController extends BaseApiController
|
|||||||
public function lists()
|
public function lists()
|
||||||
{
|
{
|
||||||
$type = $this->request->get('type', 1);
|
$type = $this->request->get('type', 1);
|
||||||
|
if ($type == 2) {
|
||||||
|
$list = MenuLogic::getUserCenterMenu($this->userInfo);
|
||||||
|
} else {
|
||||||
$list = MenuLogic::getMenu($type,$this->userInfo);
|
$list = MenuLogic::getMenu($type,$this->userInfo);
|
||||||
|
}
|
||||||
|
|
||||||
return $this->success('获取成功', $list);
|
return $this->success('获取成功', $list);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -26,6 +26,24 @@ use think\facade\Db;
|
|||||||
|
|
||||||
class MenuLogic
|
class MenuLogic
|
||||||
{
|
{
|
||||||
|
public static function getUserCenterMenu($user_info) {
|
||||||
|
$list = Db::name('decorate_page')
|
||||||
|
->where(['type' => 2])
|
||||||
|
->field('data')
|
||||||
|
->find();
|
||||||
|
$domain = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://";
|
||||||
|
$domain .= $_SERVER['HTTP_HOST'];
|
||||||
|
|
||||||
|
$arr = json_decode($list['data'], true);
|
||||||
|
foreach($arr as &$v) {
|
||||||
|
if (!empty($v['content'] && !empty($v['content']['data']))) {
|
||||||
|
foreach ($v['content']['data'] as &$v1) {
|
||||||
|
$v1['image'] = $domain . '/' . $v1['image'];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $arr;
|
||||||
|
}
|
||||||
public static function getMenu($type,$user_info)
|
public static function getMenu($type,$user_info)
|
||||||
{
|
{
|
||||||
$list = Db::name('menu_decorate')
|
$list = Db::name('menu_decorate')
|
||||||
|
|||||||
Reference in New Issue
Block a user