| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- <?php
- /**
- *------Create thems Model------
- *------SCWPHP Version 1.0.0------
- *------Dev Model Jions------
- *------Create Time 2017-06-12 05:08:18------
- */
- namespace App\Api\Model;
- use \System\Model;
- use Biz\Account\AccountManager;
- class AccountDetail extends Model {
- protected $table = 'account_detailed';
- /**
- * 修改用户基本信息
- *
- * @access public
- * @return String
- */
- public function updateUserInfo()
- {
- // 获取用户信息
- $accountManagerClass = new AccountManager;
- $userInfo = $accountManagerClass -> getCurrentUser();
- if (empty($userInfo['identity'])) {
- Render([], '2001', lang('Common','Api') -> get('user does login'));
- }
- $updateWhere['account_identity'] = $userInfo['identity'];
- $updateData = [];
- // 提取修改数据
- if (!empty($_POST['email'])) {
- $updateData['email'] = $_POST['email'];
- }
- if (!empty($_POST['phone'])) {
- $updateData['phone'] = $_POST['phone'];
- }
- if (!empty($_POST['img_id'])) {
- $updateData['img_id'] = $_POST['img_id'];
- }
- if (!empty($_POST['name'])) {
- $updateData['name'] = $_POST['name'];
- }
- if (empty($updateData)) {
- Render([], '4027', lang('Common','Api') -> get('please enter the modification'));
- }
- lm('Account_detailed', 'commons') -> updateDetailed($updateWhere, $updateData);
- }
- }
|