fix bug
This commit is contained in:
@@ -21,7 +21,7 @@ class Help
|
|||||||
if(empty($info)){
|
if(empty($info)){
|
||||||
return show("找不到该学生信息!");
|
return show("找不到该学生信息!");
|
||||||
}
|
}
|
||||||
|
$hot = $info->hot;
|
||||||
$data = [
|
$data = [
|
||||||
"userid"=>$userid,
|
"userid"=>$userid,
|
||||||
"student_id"=>$student_id,
|
"student_id"=>$student_id,
|
||||||
@@ -53,7 +53,7 @@ class Help
|
|||||||
Db::name("student")->where(["id" => $student_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, ["hot"=>$hot++]);
|
||||||
}catch (\Exception $e) {
|
}catch (\Exception $e) {
|
||||||
Db::rollback();
|
Db::rollback();
|
||||||
return show("助力失败!");
|
return show("助力失败!");
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ class Wechat
|
|||||||
$user = AppUser::create([
|
$user = AppUser::create([
|
||||||
'nickname' => $user->getNickname(),
|
'nickname' => $user->getNickname(),
|
||||||
'avatar' => $user->getAvatar(),
|
'avatar' => $user->getAvatar(),
|
||||||
'identity' => 1,
|
'identity' => 0,
|
||||||
'openid' => $user->getId(),
|
'openid' => $user->getId(),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user