Commit 512c15d5 by 冷斌

`试卷`

parent 3d1e032f
...@@ -422,72 +422,65 @@ class HomeAction extends UserAction ...@@ -422,72 +422,65 @@ class HomeAction extends UserAction
public function share() public function share()
{ {
if (!$this->is_pc) { if (!$this->is_pc) {
// $video_share = M('zy_video_share')->where(array('uid' => $this->mid))->order('ctime desc')->findPage(9);
// foreach ($video_share['data'] as $key => &$val) {
// if ($val['type'] == 0 || $val['type'] == 2) {
// $val['title'] = M('zy_video')->where(['id' => $val['video_id']])->getField('video_title');
// }
// if ($val['type'] == 1) {
// $val['title'] = M('album')->where(['id' => $val['video_id']])->getField('album_title');
// }
// if ($val['type'] == 3) {
// $val['title'] = M('zy_teacher_course')->where(['course_id' => $val['video_id']])->getField('course_name');
// }
// }
// unset($val);
// $this->assign('data', $video_share);
// $data['data'] = $this->fetch('share_list');
var_dump( $this->mid);
die;
$video_share = M('zy_video_share')->where(array('uid' => $this->mid))->order('ctime desc')->findPage(9); $this->display();
exit;
}
$tab = intval($_GET['tab']);
$tpls = array('share', 'share_money');
if (!isset($tpls[$tab])) {
$tab = 0;
}
if ($tpls[$tab] == 'share') {
$video_share = M('zy_video_share')->where(array('uid' => $this->mid))->order('ctime desc')->findPage(10);
foreach ($video_share['data'] as $key => &$val) { foreach ($video_share['data'] as $key => &$val) {
if ($val['type'] == 0 || $val['type'] == 2) { if ($val['type'] == 0 || $val['type'] == 2) {
$val['title'] = M('zy_video')->where(['id' => $val['video_id']])->getField('video_title'); $val['title'] = M('zy_video')->where(array('id' => $val['video_id']))->getField('video_title');
} }
if ($val['type'] == 1) { if ($val['type'] == 1) {
$val['title'] = M('album')->where(['id' => $val['video_id']])->getField('album_title'); $val['title'] = M('album')->where(array('id' => $val['video_id']))->getField('album_title');
} }
if ($val['type'] == 3) { if ($val['type'] == 3) {
$val['title'] = M('zy_teacher_course')->where(['course_id' => $val['video_id']])->getField('course_name'); $val['title'] = M('zy_teacher_course')->where(array('course_id' => $val['video_id']))->getField('course_name');
} }
} }
unset($val); unset($val);
$this->assign('data', $video_share); $this->assign('video_share', $video_share);
$data['data'] = $this->fetch('share_list'); } else if ($tpls[$tab] == 'share_money') {
$this->display(); $where = "share_id = {$this->mid} AND status = 1 AND is_exchange = 0";
exit;
}
// $tab = intval($_GET['tab']);
//
// $tpls = array('share', 'share_money');
// if (!isset($tpls[$tab])) {
// $tab = 0;
// }
//
// if ($tpls[$tab] == 'share') {
// $video_share = M('zy_video_share')->where(array('uid' => $this->mid))->order('ctime desc')->findPage(10);
// foreach ($video_share['data'] as $key => &$val) {
// if ($val['type'] == 0 || $val['type'] == 2) {
// $val['title'] = M('zy_video')->where(array('id' => $val['video_id']))->getField('video_title');
// }
// if ($val['type'] == 1) {
// $val['title'] = M('album')->where(array('id' => $val['video_id']))->getField('album_title');
// }
// if ($val['type'] == 3) {
// $val['title'] = M('zy_teacher_course')->where(array('course_id' => $val['video_id']))->getField('course_name');
// }
// }
// unset($val);
// $this->assign('video_share', $video_share);
// } else if ($tpls[$tab] == 'share_money') {
// $where = "share_id = {$this->mid} AND status = 1 AND is_exchange = 0";
//
// $course_share_price = M('zy_split_course')->where($where)->sum('share_sum');
// $live_share_price = M('zy_split_live')->where($where)->sum('share_sum');
// $album_share_price = M('zy_split_album')->where($where)->sum('share_sum');
//
// $share_price = $course_share_price + $live_share_price + $album_share_price;
//
// $this->assign('share_price', $share_price);
// }
// $this->assign('tab', $tab); $course_share_price = M('zy_split_course')->where($where)->sum('share_sum');
// $this->display($tpls[$tab]); $live_share_price = M('zy_split_live')->where($where)->sum('share_sum');
$album_share_price = M('zy_split_album')->where($where)->sum('share_sum');
$balancee = M('zy_split_balance')->where([ $share_price = $course_share_price + $live_share_price + $album_share_price;
'uid' => $this->mid
])->getField('balance');
var_dump($balancee, $this->mid); $this->assign('share_price', $share_price);
die; }
$this->assign('balance', $balancee); $this->assign('tab', $tab);
$this->display('share'); $this->display($tpls[$tab]);
} }
public function group() public function group()
......
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