Commit 7a9d3521 by 朱继来

Merge branch 'master' of http://119.23.72.7/zhujilai/Order into zjl_iteration_20190723

parents c975c3e3 4ec7ebb2
...@@ -47,15 +47,17 @@ class CronController extends Controller ...@@ -47,15 +47,17 @@ class CronController extends Controller
$self_accounts = $this->filterFake($self_accounts_list); // 过滤数据 $self_accounts = $this->filterFake($self_accounts_list); // 过滤数据
$self_accounts_amount = $this->countByCurrency($self_accounts, 'checkout_paid_amount'); // 统计金额 $self_accounts_amount = $this->countByCurrency($self_accounts, 'checkout_paid_amount'); // 统计金额
$resp = []; $resp = [];
// 合并用户 // 合并用户
$resp = $this->mergeUser($pay_log_amount, $joint_offline_amount); $resp = $this->mergeUser($pay_log_amount, $joint_offline_amount);
$resp = $this->mergeUser($resp, $self_accounts_amount); $resp = $this->mergeUser($resp, $self_accounts_amount);
// 保存用户金额数据 // 保存用户金额数据
if (!empty($resp)) { if (!empty($resp)) {
$cur_rate = $this->getRate();
foreach ($resp as $k=>$v) { foreach ($resp as $k=>$v) {
$data = []; $data = [];
...@@ -67,7 +69,7 @@ class CronController extends Controller ...@@ -67,7 +69,7 @@ class CronController extends Controller
$data['rmb_amount'] = isset($v['rmb']) ? $v['rmb'] : 0; $data['rmb_amount'] = isset($v['rmb']) ? $v['rmb'] : 0;
$data['usd_amount'] = isset($v['usd']) ? $v['usd'] : 0; $data['usd_amount'] = isset($v['usd']) ? $v['usd'] : 0;
$data['cur_rate'] = $this->getRate(); $data['cur_rate'] = $cur_rate;
$data['amount'] = $data['rmb_amount'] + $data['usd_amount'] * $data['cur_rate']; $data['amount'] = $data['rmb_amount'] + $data['usd_amount'] * $data['cur_rate'];
$res = $UserAmountModel->updateOrCreate(['user_id' => $k], $data); $res = $UserAmountModel->updateOrCreate(['user_id' => $k], $data);
......
...@@ -21,6 +21,7 @@ class PayLogModel extends Model ...@@ -21,6 +21,7 @@ class PayLogModel extends Model
->leftJoin('lie_order as o', 'p.order_id', '=', 'o.order_id') ->leftJoin('lie_order as o', 'p.order_id', '=', 'o.order_id')
->where('p.is_paid', 1) ->where('p.is_paid', 1)
->whereBetween('p.pay_time', [$start_time, $end_time]) ->whereBetween('p.pay_time', [$start_time, $end_time])
->where('o.status', '>', 2)
->where('o.is_type', 0) ->where('o.is_type', 0)
->select($field) ->select($field)
// ->select('user_id', DB::raw('sum(pay_amount) as pay_amount')) // ->select('user_id', DB::raw('sum(pay_amount) as pay_amount'))
......
...@@ -89,8 +89,8 @@ ...@@ -89,8 +89,8 @@
// 猎芯活动用户金额统计时间 // 猎芯活动用户金额统计时间
'lx_activity_time' => [ 'lx_activity_time' => [
'start_time' => '2018-10-1', 'start_time' => '2019-7-24',
'end_time' => '2018-10-31 23:59:59', 'end_time' => '2019-10-31 23:59:59',
], ],
......
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