作者 Cool
1 个管道 的构建 通过 耗费 1 秒

用户新增优化

@@ -102,7 +102,8 @@ class User extends Backend @@ -102,7 +102,8 @@ class User extends Backend
102 } 102 }
103 $result = $this->model->allowField(true)->save($params); 103 $result = $this->model->allowField(true)->save($params);
104 if($study) { 104 if($study) {
105 - $res['third_id'] = $params['third_id']; 105 + $study['third_id'] = $this->model->id;
  106 + $res['third_id'] = $study['third_id'];
106 $res['study_id'] = $params['study_id']; 107 $res['study_id'] = $params['study_id'];
107 $res['createtime'] = time(); 108 $res['createtime'] = time();
108 $res['playtime'] = 0; 109 $res['playtime'] = 0;
@@ -114,7 +115,6 @@ class User extends Backend @@ -114,7 +115,6 @@ class User extends Backend
114 if ($this->dataLimit && $this->dataLimitFieldAutoFill) { 115 if ($this->dataLimit && $this->dataLimitFieldAutoFill) {
115 $params[$this->dataLimitField] = $this->auth->id; 116 $params[$this->dataLimitField] = $this->auth->id;
116 } 117 }
117 - $study['third_id'] = $this->model->id;  
118 Db::name('third_study')->insertGetId($study); 118 Db::name('third_study')->insertGetId($study);
119 } 119 }
120 Db::commit(); 120 Db::commit();