fix bug
This commit is contained in:
@@ -30,7 +30,7 @@ class Help
|
||||
$data['sha'] = sha1(json_encode($data));
|
||||
|
||||
Db::startTrans();
|
||||
// try {
|
||||
try {
|
||||
$info = Db::name("app_help_log")->where("sha", $data['sha'])->find();
|
||||
if (!empty($info)) {
|
||||
return show("你今天已经为他助力过,谢谢!");
|
||||
@@ -49,15 +49,15 @@ class Help
|
||||
Db::name("app_help")->where(["id" => $appHelp['id']])->inc("count", 1)->update();
|
||||
}
|
||||
|
||||
Db::name("student")->where(["id" => $info['id']])->inc("hot", 1)->update();
|
||||
Db::name("student")->where(["id" => $info['id']])->inc("mhot_count", 1)->update();
|
||||
Db::name("student")->where(["id" => $student_id])->inc("hot", 1)->update();
|
||||
Db::name("student")->where(["id" => $student_id])->inc("mhot_count", 1)->update();
|
||||
|
||||
Db::commit();
|
||||
return show("助力成功!", SUCCESS_CODE, []);
|
||||
// }catch (\Exception $e) {
|
||||
// Db::rollback();
|
||||
// return show("助力失败!");
|
||||
// }
|
||||
}catch (\Exception $e) {
|
||||
Db::rollback();
|
||||
return show("助力失败!");
|
||||
}
|
||||
}
|
||||
|
||||
public function lists(){
|
||||
|
||||
Reference in New Issue
Block a user