Commit d6429427 by 朱继来

Merge branch 'master' into development

parents 5974e414 736dccab
Showing with 15 additions and 23 deletions
......@@ -24,11 +24,9 @@ function getCoupon($order_id)
->where(['order_id' => $order_id, 'price_type' => -4])
->first();
if ($price) {
return $price->price;
}
if (!$price) return null;
return null;
return $price->price;
}
// 获取会员账号
......@@ -53,15 +51,13 @@ function getPayName($order_id)
->select('pay_name')
->get();
if (!empty($payLog)) {
if (!$payLog) return false;
foreach ($payLog as $v) {
$payName[] = $v->pay_name;
}
return implode(',', $payName);
}
return false;
}
function getShipping($order_id, $shipping_type=1)
......@@ -73,11 +69,9 @@ function getShipping($order_id, $shipping_type=1)
->orderBy('order_shipping_id')
->get();
if (!empty($shipping)) {
return $shipping;
}
if (!$shipping) return false;
return false;
return $shipping;
}
function getInvoiceStatus($order_id)
......@@ -88,11 +82,9 @@ function getInvoiceStatus($order_id)
->select('invoice_status')
->first();
if (!empty($invoice)) {
return $invoice->invoice_status;
}
if (!$invoice) return false;
return false;
return $invoice->invoice_status;
}
function getCompanyName($user_id)
......@@ -103,16 +95,16 @@ function getCompanyName($user_id)
->select('com_name')
->first();
if (!empty($company)) {
return $company->com_name;
}
if (!$company) return false;
return false;
return $company->com_name;
}
// 获取操作人名称
function getOperatorName($uid, $type)
{
$name = '';
if ($type == 1) {
$user = DB::connection('order')->table('lie_user_main')->where('user_id', $uid)->select('user_name')->first();
......@@ -139,7 +131,7 @@ function getSalesName($sale_id)
$user = DB::table('user_info')->where('userId', $sale_id)->select('name')->first();
return isset($user->name) ? $user->name : '';
return isset($user) ? $user->name : '';
}
// 判断用户是否为新用户 -- 第一次下单
......@@ -162,7 +154,7 @@ function clientSource($user_id)
$user = DB::connection('order')->table('lie_user_main')->where('user_id', $user_id)->select('client_source')->first();
return $user->client_source;
return $user ? $user->client_source : '';
}
// 获取自营商品型号
......@@ -170,7 +162,7 @@ function getGoodsName($goods_id)
{
$goods_info = json_decode(Redis::hget('Self_SelfGoods', $goods_id), true);
return $goods_info['goods_name'];
return $goods_info ? $goods_info['goods_name'] : '';
}
// 获取订单来源
......
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