作者 耿培杰

修改接口

... ... @@ -51,6 +51,16 @@ function handleOrder($orderInfo) {
} else {
$vipEndTime = bcadd(bcmul($orderInfo['other']['keep'], bcmul(3600, 24, 0), 0), time(), 0);
}
//添加明细
$insertData = [
'user_id' => $orderInfo['other']['user_id'],
'money' => $orderInfo['other']['money'],
'memo' => '购买VIP',
'createtime' => time()
];
$userMoneyLog = new \app\api\model\UserMoneyLog();
$res1 = $userMoneyLog->addOne($insertData);
$updateData = [
'vip_level' => $orderInfo['other']['vip_level'],
'vip_endtime' => $vipEndTime,
... ...
... ... @@ -76,10 +76,10 @@ class Article extends Api
public function getArticleList()
{
$myId = $this->auth->id;
$myId = 25;
// $myId = 25;
$universityId = $this->request->param('university_id', 0, 'int');
$universityId = 892;
// $universityId = 892;
$collegeId = $this->request->param('college_id', 0, 'int');
... ... @@ -413,8 +413,19 @@ class Article extends Api
foreach ($articleTypeList as $k => $v) {
$articleTypeListObj[$v['id']] = $v;
}
$student = new Student();
foreach ($lookArticleList as $k => $v) {
$userInfo = $student->infoByUserId($v['user_id']);
if($userInfo) {
$lookArticleList[$k]['nickname'] = $userInfo['nickname'];
$lookArticleList[$k]['head_image'] = $userInfo['head_image'];
} else {
$lookArticleList[$k]['nickname'] = '';
$lookArticleList[$k]['head_image'] = '';
}
if(isset($likeStudentListObj[$v['user_id']])) {
$lookArticleList[$k]['is_like_user'] = 1;
} else {
... ... @@ -811,7 +822,7 @@ class Article extends Api
}
if($articleInfo['user_id'] != $userId) {
$this->error('');
$this->error('不能删除他人文章');
}
$res = $articleModel->delOne($articleId, ['deletetime' => time()]);
... ...