initial version (#1)

* fix(Useless Code): remove useless code

* feat(Deploy Scripts): add deploy scripts

* fix(Delopy Script): change settings

* fix(Deploy Script): fix ssh-keygen script

* fix(Deploy Script): change env file path

* feat(Deploy Script): add db migration

* fix(Deploy script): change script

* feat(Deploy Script): add sql file to create database

* fix(Deploy Script): add composer support

* fix(Deploy Script): add composer

* fix(Service Script): add http gateway

* fix(Deploy Script): add git path

* fix(Deploy Script): fix setting bugs

* fix(Init Script): get user from config

* fix(Service): adjust run users

* feat(Doc): add doc

* fix(Doc): change docs

* fix(Deploy script): change owner of storage path

* feat: codefever-community documentation system

* fix(Doc): doc details page style

* feat: fix page navigation

* fix(SQL File): fix db file fit MySQL 5.7

* fix(FileTree): empty repository display

* fix: fix helper navigation

* docs(zh-cn essential part):

* fix(Doc Style): change markdown.css

* docs(contribution doc):

* fix: unified page style

* docs(Readme): add readme

* build(Build):

Co-authored-by: cubic <carneywu@pgyer.com>
Co-authored-by: pololi <pololi@pgyer.com>
Co-authored-by: yangchen <chenyang@pgyer.com>
This commit is contained in:
Carney Wu
2022-01-19 17:21:59 +08:00
committed by GitHub
parent b4a0409675
commit d3de96487f
216 changed files with 9268 additions and 1666 deletions

View File

@@ -108,15 +108,21 @@ class User extends Base
$userInfo = Request::parse()->authData['userData'];
$data = Request::parse()->parsed;
$uKey = $userInfo['u_key'];
$field = $data['field'];
$value = $data['value'];
if (in_array($field, ['name', 'email']) && !$value) {
$name = $data['name'];
$email = $data['email'];
$team = $data['team'];
$role = $data['role'];
if (!$name || !$email) {
Response::reject(0x0201);
}
$updateData = [];
$updateData['u_' . $field] = $value;
$updateData['u_name'] = $name;
$updateData['u_email'] = $email;
$updateData['u_team'] = $team;
$updateData['u_role'] = $role;
$updateData['u_updated'] = date("Y-m-d H:i:s");
$this->db->where('u_key', $uKey);
$this->db->update('users', $updateData);