Commit 0e491e38 authored by xiabin's avatar xiabin

添加支付的部分

parent 8c861a5b
......@@ -125,6 +125,7 @@ class Orders extends \yii\db\ActiveRecord
])->one();
}
/**
* 关联下单用户信息
* @return $this
......
......@@ -141,7 +141,9 @@ class HomeController extends \yii\web\Controller
$coursewareInfo['isFavorite'] = (Favorite::findByUserIdAndCoursewareId($userId, $coursewareInfo['id']) === NULL ? FALSE : TRUE);
if (!Yii::$app->user->isGuest) {
$coursewareInfo['userAvatar'] = User::getAvatarUrl(Yii::$app->user->identity->avatar);
$coursewareInfo['isShop'] = (Orders::findByUserIdAndCourseId($userId, $courseId) === NULL ? FALSE : TRUE);
$order = Orders::findByUserIdAndCourseId($userId, $courseId);
var_dump($order->status);
$coursewareInfo['isShop'] = ($order !== NULL and $order->status === Orders::PAID ? TRUE : FALSE);
}
$coursewareInfo['price'] = $course->price;
$coursewareInfo['classId'] = $course->class_id;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment