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

已售课程列表完成

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