Commit f15e8097 by 朱继来

调整用户退款金额

parent cd750195
...@@ -115,7 +115,7 @@ class CronController extends Controller ...@@ -115,7 +115,7 @@ class CronController extends Controller
return $RedisModel->get('api_lx_activity_user_rank'); return $RedisModel->get('api_lx_activity_user_rank');
} }
// 过滤掉联营账期 // 过滤掉联营账期 (账期从ERP支付记录中获取)
public function filterJointAccounts($data) public function filterJointAccounts($data)
{ {
if (!$data) return false; if (!$data) return false;
...@@ -243,7 +243,7 @@ class CronController extends Controller ...@@ -243,7 +243,7 @@ class CronController extends Controller
$UserAmountModel = new UserAmountModel(); $UserAmountModel = new UserAmountModel();
$RedisModel = new RedisModel(); $RedisModel = new RedisModel();
$UserAmountModel->truncate(); // 清空数据 // $UserAmountModel->truncate(); // 清空数据
$RedisModel->set('api_lx_activity_user_rank', null); $RedisModel->set('api_lx_activity_user_rank', null);
} }
......
...@@ -315,13 +315,16 @@ class OrderRefundModel extends Model ...@@ -315,13 +315,16 @@ class OrderRefundModel extends Model
return $tmp; return $tmp;
} }
// 获取活动期间已完成退款的用户金额 // 获取活动期间已完成退款的用户金额 (过滤掉联营账期)
public function getJointReturnAmount($user_id, $start_time, $end_time) public function getJointReturnAmount($user_id, $start_time, $end_time)
{ {
return $this->where('user_id', $user_id) return $this->from('lie_order_refund as r')
->where('status', 10) ->leftJoin('lie_order as o', 'r.order_id', '=', 'o.order_id')
->whereBetween('refund_time', [$start_time, $end_time]) ->where('r.user_id', $user_id)
->select('user_id', 'currency', 'pay_amount', 'price_fall') ->where('r.status', 10)
->whereBetween('r.refund_time', [$start_time, $end_time])
->where('o.order_pay_type', '<>', 3)
->select('r.user_id', 'r.currency', 'r.pay_amount', 'r.price_fall')
->get() ->get()
->toArray(); ->toArray();
} }
......
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 sign in to comment