作者 开飞机的舒克

取消战队di

... ... @@ -212,7 +212,7 @@ class Activity extends Api
$model = new ItemDetails();
$res = db('study')->where('user_id',$user['id'])->find();
if (!empty($res)) {
$list = $model->where(['item_id' => $id, 'team_id' => $res['team_id']])->find()->toArray();
$list = $model->where(['item_id' => $id, 'team' => $res['team']])->find()->toArray();
$data['images'] = $list['images'];
}
$data['holdtime'] = date('Y-m-d',$data['holdtime']);
... ...
... ... @@ -192,9 +192,9 @@ class Bind extends Api
if (empty($unique) && empty($id)) {
$this->error('参数错误', ['status' => 2]);
}
$study = db('study')->where('unique', $unique)->field('id,grade,name,team_id,earn_score')->find();
$study = db('study')->where('unique', $unique)->field('id,grade,name,team,earn_score')->find();
$item = db('item')->where('id', $id)->field('score,title,campus_id')->find();
$team = \db('team')->where('id', $study['team_id'])->field('title,score')->find();
$team = \db('team')->where('title', $study['team'])->field('title,score')->find();
$sum1 = $team['score'] + $item['score']; //合计战队总分
$sum2 = $study['earn_score'] + $item['score']; //合计个人总分
Db::startTrans();
... ... @@ -203,7 +203,7 @@ class Bind extends Api
'item_id' => $id,
'campus_id' => $item['campus_id'],
'study_id' => $study['id'],
'team_id' => $study['team_id'],
'team' => $study['team'],
'score' => $item['score'],
'memo' => $study['name'] . '参加' . $item['title'] . '加分',
'createtime' => time()
... ... @@ -214,7 +214,7 @@ class Bind extends Api
'earn_score' => $sum2,
]);
\db('team')
->where('id', $study['team_id'])
->where('title', $study['team'])
->update([
'score' => $sum1,
'updatetime' => time()
... ...
... ... @@ -175,7 +175,7 @@ class Index extends Api
{
"title": "战队名称",
"score": "战队总分",
"team_id": 战队id
"team": 战队
},
]
},
... ... @@ -193,7 +193,7 @@ class Index extends Api
$this->error('参数错误', ['status' => 2]);
}
$data = \db('study_score_log l')
->distinct('l.team_id')
->distinct('l.team')
->join('team t', 't.title = l.team')
->where('l.campus_id', $campus)
->field('t.title,t.score,l.team,l.campus_id')
... ...
... ... @@ -2064,7 +2064,7 @@
{
"title": "战队名称",
"score": "战队总分",
"team_id": 战队id
"team": 战队
},
]
},
... ... @@ -5921,7 +5921,7 @@
</div>
<div class="col-md-6" align="right">
Generated on 2023-04-07 18:28:49 <a href="./" target="_blank">校园活动</a>
Generated on 2023-04-07 18:36:09 <a href="./" target="_blank">校园活动</a>
</div>
</div>
... ...