Commit 693d0b1e authored by 杨培's avatar 杨培

已售课程列表完成

parent 9a29fa00
......@@ -76,7 +76,7 @@ class Income extends \yii\db\ActiveRecord
public function getOrder()
{
return $this->hasOne(Orders::className(), ['id'=>'orders_id'])->with('user')->with('courseWithTeachers');
return $this->hasOne(Orders::className(), ['id'=>'orders_id'])->with('user')->with('course');
}
//public function getUser()
......
......@@ -10,9 +10,13 @@ class MyIncomeController extends \yii\web\Controller
public $layout = 'classCenter';
/**
* 售课记录
* @return string
*/
public function actionIndex()
{
$ret = Income::getIncomeListByUserId(Yii::$app->user->getId(), null);
$ret = Income::getIncomeListByUserId(Yii::$app->user->getId(), null, 20);
return $this->render('index', $ret);
}
......
......@@ -34,25 +34,15 @@ $this->title = '知识有价';
<?php foreach ($data as $row) { ?>
<tr>
<td>
20012313131<br/>
2016-12-11
<?=$row['order']['number']?><br/>
<?=date('Y-m-d H:i', $row['order']['updated_at'])?>
</td>
<td><?=$row['order']['user']['telephone']?> / <?=$row['order']['user']['username']?></td>
<td>《<?=$row['order']['courseWithTeachers']['name']?>》</td>
<td>¥123.00</td>
<td>审核中</td>
<td>《<?=$row['order']['course']['name']?>》</td>
<td>¥<?=$row['order']['credit']?></td>
<td><?=($row['status'] ? '未结算' : '已结算')?></td>
</tr>
<?php } ?>
<tr>
<td>
20012313131<br/>
2016-12-11
</td>
<td>18788860327 / 百丐洪七公</td>
<td>《中国为什么这么久还没有进入社会主义社会》</td>
<td>¥123.00</td>
<td>审核中</td>
</tr>
</tbody>
</table>
......
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