vr-shopxo-source/app/index/controller/Personal.php

115 lines
2.9 KiB
PHP
Raw Normal View History

2018-12-28 10:58:37 +00:00
<?php
// +----------------------------------------------------------------------
// | ShopXO 国内领先企业级B2C免费开源电商系统
// +----------------------------------------------------------------------
2021-03-16 02:34:52 +00:00
// | Copyright (c) 2011~2099 http://shopxo.net All rights reserved.
2018-12-28 10:58:37 +00:00
// +----------------------------------------------------------------------
2021-03-16 02:34:52 +00:00
// | Licensed ( https://opensource.org/licenses/mit-license.php )
2018-12-28 10:58:37 +00:00
// +----------------------------------------------------------------------
// | Author: Devil
// +----------------------------------------------------------------------
namespace app\index\controller;
use app\service\ApiService;
2019-12-24 07:18:56 +00:00
use app\service\SeoService;
use app\service\UserService;
2019-03-15 09:46:35 +00:00
use app\service\NavigationService;
2018-12-28 10:58:37 +00:00
/**
* 个人资料
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2017-03-02T22:48:35+0800
*/
class Personal extends Common
{
/**
* 构造方法
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-11-30
* @desc description
*/
public function __construct()
{
parent::__construct();
// 是否登录
2019-02-14 15:06:04 +00:00
$this->IsLogin();
2018-12-28 10:58:37 +00:00
}
/**
* 资料页
2018-12-28 10:58:37 +00:00
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2017-02-22T16:50:32+0800
*/
public function Index()
{
// 模板数据
$assign = [
// 用户展示数据
'personal_show_list' => NavigationService::UsersPersonalShowFieldList(),
// 浏览器名称
'home_seo_site_title' => SeoService::BrowserSeoTitle('个人资料', 1),
];
MyViewAssign($assign);
2021-07-18 15:42:10 +00:00
return MyView();
2018-12-28 10:58:37 +00:00
}
/**
* 编辑页面
2018-12-28 10:58:37 +00:00
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2017-03-26T14:26:01+0800
*/
public function SaveInfo()
{
// 模板数据
$assign = [
// 用户数据
'data' => UserService::UserHandle(UserService::UserInfo('id', $this->user['id'])),
// 性别
'common_gender_list' => MyConst('common_gender_list'),
// 浏览器名称
'home_seo_site_title' => SeoService::BrowserSeoTitle('个人资料编辑', 1),
];
MyViewAssign($assign);
2021-07-18 15:42:10 +00:00
return MyView();
2018-12-28 10:58:37 +00:00
}
/**
* 保存
2018-12-28 10:58:37 +00:00
* @author Devil
* @blog http://gong.gg/
* @version 0.0.1
* @datetime 2017-03-26T14:26:34+0800
*/
public function Save()
{
$params = $this->data_post;
2018-12-28 10:58:37 +00:00
$params['user'] = $this->user;
return ApiService::ApiDataReturn(UserService::PersonalSave($params));
2018-12-28 10:58:37 +00:00
}
/**
* 用户头像上传
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2018-12-03
* @desc description
*/
public function UserAvatarUpload()
{
$params = $this->data_post;
$params['user'] = $this->user;
$params['img_field'] = 'file';
return ApiService::ApiDataReturn(UserService::UserAvatarUpload($params));
}
2018-12-28 10:58:37 +00:00
}
?>