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