Commit 9a29fa00 authored by 杨培's avatar 杨培

orders 增加 courseWithTeachers

parent 1cf69a22
...@@ -76,7 +76,7 @@ class Income extends \yii\db\ActiveRecord ...@@ -76,7 +76,7 @@ class Income extends \yii\db\ActiveRecord
public function getOrder() public function getOrder()
{ {
return $this->hasOne(Orders::className(), ['id'=>'orders_id'])->with('user')->with('course'); return $this->hasOne(Orders::className(), ['id'=>'orders_id'])->with('user')->with('courseWithTeachers');
} }
//public function getUser() //public function getUser()
......
...@@ -130,4 +130,9 @@ class Orders extends \yii\db\ActiveRecord ...@@ -130,4 +130,9 @@ class Orders extends \yii\db\ActiveRecord
return $this->hasOne(Course::className(), ['id'=>'course_id'])->select('id,user_id,name,price,preview_pic'); return $this->hasOne(Course::className(), ['id'=>'course_id'])->select('id,user_id,name,price,preview_pic');
} }
public function getCourseWithTeachers()
{
return $this->hasOne(Course::className(), ['id'=>'course_id'])->select('id,user_id,name,price,preview_pic')->with('teachers');
}
} }
...@@ -37,8 +37,8 @@ $this->title = '知识有价'; ...@@ -37,8 +37,8 @@ $this->title = '知识有价';
20012313131<br/> 20012313131<br/>
2016-12-11 2016-12-11
</td> </td>
<td><?=$row['order']['user']['']?> / 百丐洪七公</td> <td><?=$row['order']['user']['telephone']?> / <?=$row['order']['user']['username']?></td>
<td>《中国为什么这么久还没有进入社会主义社会》</td> <td>《<?=$row['order']['courseWithTeachers']['name']?>》</td>
<td>¥123.00</td> <td>¥123.00</td>
<td>审核中</td> <td>审核中</td>
</tr> </tr>
......
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