作者 耿培杰

修改接口

@@ -51,6 +51,16 @@ function handleOrder($orderInfo) { @@ -51,6 +51,16 @@ function handleOrder($orderInfo) {
51 } else { 51 } else {
52 $vipEndTime = bcadd(bcmul($orderInfo['other']['keep'], bcmul(3600, 24, 0), 0), time(), 0); 52 $vipEndTime = bcadd(bcmul($orderInfo['other']['keep'], bcmul(3600, 24, 0), 0), time(), 0);
53 } 53 }
  54 + //添加明细
  55 + $insertData = [
  56 + 'user_id' => $orderInfo['other']['user_id'],
  57 + 'money' => $orderInfo['other']['money'],
  58 + 'memo' => '购买VIP',
  59 + 'createtime' => time()
  60 + ];
  61 + $userMoneyLog = new \app\api\model\UserMoneyLog();
  62 + $res1 = $userMoneyLog->addOne($insertData);
  63 +
54 $updateData = [ 64 $updateData = [
55 'vip_level' => $orderInfo['other']['vip_level'], 65 'vip_level' => $orderInfo['other']['vip_level'],
56 'vip_endtime' => $vipEndTime, 66 'vip_endtime' => $vipEndTime,
@@ -76,10 +76,10 @@ class Article extends Api @@ -76,10 +76,10 @@ class Article extends Api
76 public function getArticleList() 76 public function getArticleList()
77 { 77 {
78 $myId = $this->auth->id; 78 $myId = $this->auth->id;
79 - $myId = 25; 79 +// $myId = 25;
80 80
81 $universityId = $this->request->param('university_id', 0, 'int'); 81 $universityId = $this->request->param('university_id', 0, 'int');
82 - $universityId = 892; 82 +// $universityId = 892;
83 83
84 $collegeId = $this->request->param('college_id', 0, 'int'); 84 $collegeId = $this->request->param('college_id', 0, 'int');
85 85
@@ -413,8 +413,19 @@ class Article extends Api @@ -413,8 +413,19 @@ class Article extends Api
413 foreach ($articleTypeList as $k => $v) { 413 foreach ($articleTypeList as $k => $v) {
414 $articleTypeListObj[$v['id']] = $v; 414 $articleTypeListObj[$v['id']] = $v;
415 } 415 }
  416 + $student = new Student();
416 417
417 foreach ($lookArticleList as $k => $v) { 418 foreach ($lookArticleList as $k => $v) {
  419 +
  420 + $userInfo = $student->infoByUserId($v['user_id']);
  421 + if($userInfo) {
  422 + $lookArticleList[$k]['nickname'] = $userInfo['nickname'];
  423 + $lookArticleList[$k]['head_image'] = $userInfo['head_image'];
  424 + } else {
  425 + $lookArticleList[$k]['nickname'] = '';
  426 + $lookArticleList[$k]['head_image'] = '';
  427 + }
  428 +
418 if(isset($likeStudentListObj[$v['user_id']])) { 429 if(isset($likeStudentListObj[$v['user_id']])) {
419 $lookArticleList[$k]['is_like_user'] = 1; 430 $lookArticleList[$k]['is_like_user'] = 1;
420 } else { 431 } else {
@@ -811,7 +822,7 @@ class Article extends Api @@ -811,7 +822,7 @@ class Article extends Api
811 } 822 }
812 823
813 if($articleInfo['user_id'] != $userId) { 824 if($articleInfo['user_id'] != $userId) {
814 - $this->error(''); 825 + $this->error('不能删除他人文章');
815 } 826 }
816 827
817 $res = $articleModel->delOne($articleId, ['deletetime' => time()]); 828 $res = $articleModel->delOne($articleId, ['deletetime' => time()]);