Commit f15e8097 by 朱继来

调整用户退款金额

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