Commit 4d7c7ff6 by 朱继来

调整新用户判断

parent 948587ca
......@@ -186,11 +186,13 @@ function getSalesName($sale_id)
}
// 判断用户是否为新用户 -- 第一次下单
function isNewClient($order_id)
function isNewClient($order_goods_type, $user_id, $create_time)
{
$order = DB::connection('order')->table('lie_order')->where('order_id', $order_id)->select('sale_id')->first();
$order = DB::connection('order')->table('lie_order')->where('order_goods_type', $order_goods_type)->where('user_id', $user_id)->where('create_time', '<', $create_time)->get();
return $order->sale_id == 0 ? true : false;
$user = DB::connection('order')->table('lie_user_main')->where('user_id', $user_id)->first();
return empty($order) && empty($user->client_source) ? true : false;
}
// 用户来源
......
......@@ -15,7 +15,7 @@
<input type="hidden" name="check_failed_info" value="">
<input type="hidden" name="change_pay_type" value="">
<?php $isNewClient = App\Http\Controllers\isNewClient($order_info['order_id']); ?>
<?php $isNewClient = App\Http\Controllers\isNewClient($order_info['order_goods_type'], $order_info['user_id'], $order_info['create_time']); ?>
@if ($isNewClient)
<!-- 用户来源 -->
<p>用户来源</p>
......
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