|
|
@@ -455,7 +455,7 @@ class Pay extends Api
|
|
|
//$this->success(__('获取成功'),$response);
|
|
|
echo $response;
|
|
|
}
|
|
|
-
|
|
|
+//支付宝回调
|
|
|
public function notify()
|
|
|
{
|
|
|
if ($_POST) {
|
|
|
@@ -604,6 +604,11 @@ class Pay extends Api
|
|
|
$this->error(__('单剧集购买版权不能超过10份'));
|
|
|
}
|
|
|
}
|
|
|
+ $user_share = Db::name('videolist')->where('id', $vid)->value('share');
|
|
|
+ $user_shares = $user_share - $num;
|
|
|
+ if ($user_shares < 0) {
|
|
|
+ $this->error(__('该局总版权只剩下' .$user_share. '份'));
|
|
|
+ }
|
|
|
// if($datavideo_order){
|
|
|
// if($datavideo_order['type']==2){
|
|
|
// $this->error(__('该订单已支付'));
|
|
|
@@ -684,6 +689,7 @@ class Pay extends Api
|
|
|
//var_dump($data['paytype']);
|
|
|
if ($data['paytype'] == '支付宝') {
|
|
|
$this->allpay($amount, $subject, $body, $number, $notify_url);
|
|
|
+
|
|
|
} else if ($data['paytype'] == '余额') {
|
|
|
$this->shareyuepay($amount, input('uid'), $id);
|
|
|
} else if ($data['paytype'] == '微信') {
|
|
|
@@ -810,6 +816,11 @@ class Pay extends Api
|
|
|
$this->dailiyongjin($id, $data['vid'], 0, $user_id, $money, '佣金结算');//后台代理佣金结算
|
|
|
$this->grade_sell($data['out_trade_no']);//判断订单的用户是否有上级以及判断推荐等级)
|
|
|
|
|
|
+// 扣除短剧总版权
|
|
|
+ $shares = Db::name('videolist')->where('id', $data['vid'])->value('share');
|
|
|
+ $share = $shares - $data['num'];
|
|
|
+ Db::name('videolist')->where('id', $data['vid'])->update(['share' => $share]);
|
|
|
+
|
|
|
Db::commit();
|
|
|
$this->success(__('操作成功'));
|
|
|
} catch (Exception $e) {
|