Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
朱继来
/
后台订单管理
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
736dccab
authored
Mar 07, 2019
by
朱继来
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
调整用户来源等
parent
6042972e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
25 deletions
app/Http/Controllers/OrderController.php
app/Http/Controllers/OrderController.php
View file @
736dccab
...
@@ -24,11 +24,9 @@ function getCoupon($order_id)
...
@@ -24,11 +24,9 @@ function getCoupon($order_id)
->
where
([
'order_id'
=>
$order_id
,
'price_type'
=>
-
4
])
->
where
([
'order_id'
=>
$order_id
,
'price_type'
=>
-
4
])
->
first
();
->
first
();
if
(
$price
)
{
if
(
!
$price
)
return
null
;
return
$price
->
price
;
}
return
null
;
return
$price
->
price
;
}
}
// 获取会员账号
// 获取会员账号
...
@@ -53,15 +51,13 @@ function getPayName($order_id)
...
@@ -53,15 +51,13 @@ function getPayName($order_id)
->
select
(
'pay_name'
)
->
select
(
'pay_name'
)
->
get
();
->
get
();
if
(
!
empty
(
$payLog
))
{
if
(
!
$payLog
)
return
false
;
foreach
(
$payLog
as
$v
)
{
$payName
[]
=
$v
->
pay_name
;
}
return
implode
(
','
,
$payName
);
foreach
(
$payLog
as
$v
)
{
$payName
[]
=
$v
->
pay_name
;
}
}
return
false
;
return
implode
(
','
,
$payName
)
;
}
}
function
getShipping
(
$order_id
,
$shipping_type
=
1
)
function
getShipping
(
$order_id
,
$shipping_type
=
1
)
...
@@ -73,11 +69,9 @@ function getShipping($order_id, $shipping_type=1)
...
@@ -73,11 +69,9 @@ function getShipping($order_id, $shipping_type=1)
->
orderBy
(
'order_shipping_id'
)
->
orderBy
(
'order_shipping_id'
)
->
get
();
->
get
();
if
(
!
empty
(
$shipping
))
{
if
(
!
$shipping
)
return
false
;
return
$shipping
;
}
return
false
;
return
$shipping
;
}
}
function
getInvoiceStatus
(
$order_id
)
function
getInvoiceStatus
(
$order_id
)
...
@@ -88,11 +82,9 @@ function getInvoiceStatus($order_id)
...
@@ -88,11 +82,9 @@ function getInvoiceStatus($order_id)
->
select
(
'invoice_status'
)
->
select
(
'invoice_status'
)
->
first
();
->
first
();
if
(
!
empty
(
$invoice
))
{
if
(
!
$invoice
)
return
false
;
return
$invoice
->
invoice_status
;
}
return
false
;
return
$invoice
->
invoice_status
;
}
}
function
getCompanyName
(
$user_id
)
function
getCompanyName
(
$user_id
)
...
@@ -103,16 +95,16 @@ function getCompanyName($user_id)
...
@@ -103,16 +95,16 @@ function getCompanyName($user_id)
->
select
(
'com_name'
)
->
select
(
'com_name'
)
->
first
();
->
first
();
if
(
!
empty
(
$company
))
{
if
(
!
$company
)
return
false
;
return
$company
->
com_name
;
}
return
fals
e
;
return
$company
->
com_nam
e
;
}
}
// 获取操作人名称
// 获取操作人名称
function
getOperatorName
(
$uid
,
$type
)
function
getOperatorName
(
$uid
,
$type
)
{
{
$name
=
''
;
if
(
$type
==
1
)
{
if
(
$type
==
1
)
{
$user
=
DB
::
connection
(
'order'
)
->
table
(
'lie_user_main'
)
->
where
(
'user_id'
,
$uid
)
->
select
(
'user_name'
)
->
first
();
$user
=
DB
::
connection
(
'order'
)
->
table
(
'lie_user_main'
)
->
where
(
'user_id'
,
$uid
)
->
select
(
'user_name'
)
->
first
();
...
@@ -139,7 +131,7 @@ function getSalesName($sale_id)
...
@@ -139,7 +131,7 @@ function getSalesName($sale_id)
$user
=
DB
::
table
(
'user_info'
)
->
where
(
'userId'
,
$sale_id
)
->
select
(
'name'
)
->
first
();
$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)
...
@@ -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
();
$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)
...
@@ -170,7 +162,7 @@ function getGoodsName($goods_id)
{
{
$goods_info
=
json_decode
(
Redis
::
hget
(
'Self_SelfGoods'
,
$goods_id
),
true
);
$goods_info
=
json_decode
(
Redis
::
hget
(
'Self_SelfGoods'
,
$goods_id
),
true
);
return
$goods_info
[
'goods_name'
]
;
return
$goods_info
?
$goods_info
[
'goods_name'
]
:
''
;
}
}
// 获取订单来源
// 获取订单来源
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment