Commit e00966c8 by 冷斌

fix bug

parent e72611ec
......@@ -408,6 +408,7 @@ class ZyServiceModel
*/
public function buyOnlineVideo($uid, $video_id, $ext_data = array(), $ext_mount = [], $asb)
{
var_dump('log: 1');
if ($this->checkVideoAccess($uid, $video_id)) {
return 1;
}
......@@ -426,9 +427,10 @@ class ZyServiceModel
))->field("id,uid,video_title,mhm_id,teacher_id,v_price,t_price,vip_level,endtime,starttime,limit_discount,term")->find();
//找不到课程
if (!$video) {
var_dump('log: 2');
return 2;
}
var_dump('log: 3');
$error_return = $this->_errorReturn($video, 'course');
if ($error_return !== false) {
return $error_return;
......@@ -526,7 +528,7 @@ class ZyServiceModel
// 添加分成明细
$price = isset($ext_data['price']) ? $ext_data['price'] : $prices['price'];
$split_status = $this->addSplit($id, $uid, $video, $price, 'course', [], $mount_id);
var_dump('log: 5');
if (!$split_status) {
//创建订单明细流水失败 并删除此订单
M('zy_order_course')->where(array('id' => $id))->delete();
......
......@@ -902,12 +902,10 @@ class PayVideoAction extends CommonAction
if ($pay_status == 3) {
$this->mzError("已购买此课时");
} else if (in_array($pay_status, [2, 5, 7, 8]) || !$pay_status) {
var_dump('log: 1');
$i = D('ZyService', 'classroom')->buyOnlineVideoHour(intval($this->mid), $vid, $course_hour_id, [$mount_mhm_id, $agent_mhm_id]);
} else if ($pay_status == 4) {
$this->mzError("该课时正在申请退款");
} else if ($pay_status == 1) {
var_dump('log: 2');
$i = true;
}
} else {
......@@ -921,14 +919,12 @@ class PayVideoAction extends CommonAction
if ($cid !== $coupon_id) {
D('Coupon', 'classroom')->cancelExchangeCard($cid);
}
var_dump('log: 3');
$i = D('ZyService', 'classroom')->buyOnlineVideo(intval($this->mid), $vid, $ext_data, [$mount_mhm_id, $agent_mhm_id], $ext_asb);
} else if (in_array($pay_status, [1, 2, 5, 7, 8]) || !$pay_status) {
$cid = M('zy_order_course')->where(array('uid' => intval($this->mid), 'video_id' => $vid))->getField('coupon_id');
if ($cid !== $coupon_id) {
D('Coupon', 'classroom')->cancelExchangeCard($cid);
}
var_dump('log: 4');
$i = D('ZyService', 'classroom')->buyOnlineVideo(intval($this->mid), $vid, $ext_data, [$mount_mhm_id, $agent_mhm_id], $ext_asb);
} else if ($pay_status == 4) {
$this->mzError("该课程正在申请退款");
......
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