作者 开飞机的舒克

后台优化

@@ -60,6 +60,8 @@ class Study extends Backend @@ -60,6 +60,8 @@ class Study extends Backend
60 60
61 foreach ($list as $row) { 61 foreach ($list as $row) {
62 $row->visible(['id','avatar','name','gender','birthday','grade_id','school_id','sno','team_id','team_rank','earn_score','phone','unique','barcode']); 62 $row->visible(['id','avatar','name','gender','birthday','grade_id','school_id','sno','team_id','team_rank','earn_score','phone','unique','barcode']);
  63 + $path = "http://campus.shs.broing.cn/";
  64 + $row->visible([$path.'barcode']);
63 $row->visible(['grade']); 65 $row->visible(['grade']);
64 $row->getRelation('grade')->visible(['id','name']); 66 $row->getRelation('grade')->visible(['id','name']);
65 $row->visible(['school']); 67 $row->visible(['school']);
@@ -182,9 +184,9 @@ class Study extends Backend @@ -182,9 +184,9 @@ class Study extends Backend
182 $result = $this->model->allowField(true)->save($params); 184 $result = $this->model->allowField(true)->save($params);
183 $id = $this->model->id; 185 $id = $this->model->id;
184 $unique = time(); 186 $unique = time();
185 - //$brpath = Resource::StudyBar($unique); 187 + $barpath = Resource::StudyBar($unique);
186 $time = date('YmdHi',time()); 188 $time = date('YmdHi',time());
187 - $this->model->save(['sno'=>$time,'unique'=>time()],['id'=>$id]); 189 + $this->model->save(['barcode'=>$barpath,'sno'=>$time,'unique'=>time()],['id'=>$id]);
188 Db::commit(); 190 Db::commit();
189 } catch (ValidateException|PDOException|Exception $e) { 191 } catch (ValidateException|PDOException|Exception $e) {
190 Db::rollback(); 192 Db::rollback();
@@ -69,8 +69,8 @@ class Demo extends Api @@ -69,8 +69,8 @@ class Demo extends Api
69 */ 69 */
70 public function test3() 70 public function test3()
71 { 71 {
72 - $a = Resource::StudyBar(1);  
73 - return $a; 72 +// $a = Resource::StudyBar(1);
  73 +// return $a;
74 } 74 }
75 75
76 } 76 }