fix bug
This commit is contained in:
37
app/controller/Donation.php
Normal file
37
app/controller/Donation.php
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
<?php
|
||||||
|
namespace app\controller;
|
||||||
|
|
||||||
|
use app\facade\Db;
|
||||||
|
|
||||||
|
class Donation
|
||||||
|
{
|
||||||
|
public function lists(){
|
||||||
|
if(empty($GLOBALS['data']['data']['student_id'])){
|
||||||
|
return show("请正确上传用户信息!", ERROR_CODE,[]);
|
||||||
|
}
|
||||||
|
$student_id = $GLOBALS['data']['data']['student_id'];
|
||||||
|
|
||||||
|
$result = [];
|
||||||
|
//查询用户信息
|
||||||
|
$result['userinfo'] = [];
|
||||||
|
$userinfo = \think\facade\Db::name("student")->where("id",$student_id)->field("nickname,identifier,avatar,age,type,disabled as is_disabled,city,school,hot,hot_count")->find();
|
||||||
|
if(!empty($userinfo)){
|
||||||
|
$result['userinfo'] = $userinfo;
|
||||||
|
}
|
||||||
|
$result['donation_list'] = [];
|
||||||
|
$list = Db::name("order")->where(['student_id' => $student_id,"status"=>1])->select()->toArray();
|
||||||
|
$users = getAllUsersMessage($list,"user_id","nickname,avatar,shiyou_id");
|
||||||
|
|
||||||
|
foreach($list as $vo){
|
||||||
|
$result['donation_list'][] = [
|
||||||
|
"nickname"=>$users[$vo["user_id"]]['nickname'],
|
||||||
|
"identity"=>empty($users[$vo["user_id"]]['shiyou_id'])?1:0,
|
||||||
|
"amount"=>$vo['amount'],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
return show("获取成功",SUCCESS_CODE,$result);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -40,5 +40,4 @@ class Order
|
|||||||
|
|
||||||
return show("订单创建成功!", SUCCESS_CODE, $order->id);
|
return show("订单创建成功!", SUCCESS_CODE, $order->id);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -152,6 +152,7 @@ class Wechat
|
|||||||
//为用户增加助力值
|
//为用户增加助力值
|
||||||
$zhuLi = env("ZHULI_VALUE")??150;
|
$zhuLi = env("ZHULI_VALUE")??150;
|
||||||
Db::name("student")->inc("hot",$zhuLi)->where("id",$order_detail->id)->update();
|
Db::name("student")->inc("hot",$zhuLi)->where("id",$order_detail->id)->update();
|
||||||
|
Db::name("student")->inc("hot_count",1)->where("id",$order_detail->id)->update();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
$fail('Order not exists.');
|
$fail('Order not exists.');
|
||||||
|
|||||||
Reference in New Issue
Block a user