Commit d56bef73 by 朱继来

调整

parent ad9f3379
...@@ -33,8 +33,8 @@ class CronController extends Controller ...@@ -33,8 +33,8 @@ class CronController extends Controller
// 查询联营、自营线上支付记录 // 查询联营、自营线上支付记录
$pay_log_list = $PayLogModel->getPayLog($start_time, $end_time); $pay_log_list = $PayLogModel->getPayLog($start_time, $end_time);
$pay_log = $this->filterFake($pay_log_list); // 过滤数据 // $pay_log = $this->filterFake($pay_log_list); // 过滤数据
$pay_log_amount = $this->countByCurrency($pay_log); // 统计金额 $pay_log_amount = $this->countByCurrency($pay_log_list); // 统计金额
// 联营线下支付记录 // 联营线下支付记录
$joint_offline_list = $ErpPayLogModel->getErpPayLog($start_time, $end_time); $joint_offline_list = $ErpPayLogModel->getErpPayLog($start_time, $end_time);
...@@ -62,7 +62,7 @@ class CronController extends Controller ...@@ -62,7 +62,7 @@ class CronController extends Controller
$user = $UserMainModel->getUserAccount($k); // 获取用户账号 $user = $UserMainModel->getUserAccount($k); // 获取用户账号
if ($user) { if ($user) {
$data['account'] = isset($user['mobile']) ? $user['mobile'] : $user['email']; $data['account'] = $user['mobile'] ? $user['mobile'] : $user['email'];
} }
$data['rmb_amount'] = isset($v['rmb']) ? $v['rmb'] : 0; $data['rmb_amount'] = isset($v['rmb']) ? $v['rmb'] : 0;
......
...@@ -16,12 +16,15 @@ class PayLogModel extends Model ...@@ -16,12 +16,15 @@ class PayLogModel extends Model
// 获取联营、自营线上支付记录 // 获取联营、自营线上支付记录
public function getPayLog($start_time, $end_time) public function getPayLog($start_time, $end_time)
{ {
$field = ['pay_log_id', 'order_id', 'order_sn', 'user_id', 'pay_type', 'is_paid', 'pay_amount', 'pay_time']; $field = ['p.pay_log_id', 'p.order_id', 'p.order_sn', 'p.user_id', 'p.pay_type', 'p.is_paid', 'p.pay_amount', 'p.pay_time', 'o.currency'];
$data = $this->where('is_paid', 1) $data = $this->from('lie_pay_log as p')
->whereBetween('pay_time', [$start_time, $end_time]) ->leftJoin('lie_order as o', 'p.order_id', '=', 'o.order_id')
->where('p.is_paid', 1)
->whereBetween('p.pay_time', [$start_time, $end_time])
->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'))
->orderBy('pay_time', 'desc') ->orderBy('p.pay_time', 'desc')
// ->groupBy('user_id') // ->groupBy('user_id')
->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