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
e5cb40aa
authored
May 28, 2018
by
朱继来
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
添加计数
parent
c4abb3bb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
70 additions
and
0 deletions
app/Http/Controllers/OrderController.php
app/Http/routes.php
app/Http/Controllers/OrderController.php
View file @
e5cb40aa
...
...
@@ -1716,4 +1716,72 @@ Class OrderController extends Controller
return
[
'errcode'
=>
0
,
'errmsg'
=>
'延长成功'
];
}
public
function
tempCount
(
Request
$request
)
{
$current
=
strtotime
(
date
(
'Y-m-d'
,
time
()));
// 当天0点
$half
=
strtotime
(
'2017-11-28'
);
// 半年
$year
=
strtotime
(
'2017-05-28'
);
// 一年
// 订单数量
$halfCount
=
DB
::
connection
(
'order'
)
->
table
(
'lie_order'
)
// ->where('order_goods_type', 1)
// ->where('order_type', 1)
->
whereNotIn
(
'user_id'
,
$this
->
testMobile
())
->
where
(
'is_type'
,
0
)
->
whereBetween
(
'create_time'
,
[
$half
,
$current
])
->
count
();
echo
'半年订单数:'
.
$halfCount
.
'<br>'
;
$yearCount
=
DB
::
connection
(
'order'
)
->
table
(
'lie_order'
)
->
whereNotIn
(
'user_id'
,
$this
->
testMobile
())
->
where
(
'is_type'
,
0
)
->
whereBetween
(
'create_time'
,
[
$year
,
$current
])
->
count
();
echo
'一年订单数:'
.
$yearCount
.
'<br>'
;
// 普票订单数
$halfInvoice
=
DB
::
connection
(
'order'
)
->
table
(
'lie_order as o'
)
->
leftJoin
(
'lie_order_invoice as i'
,
'o.order_id'
,
'='
,
'i.order_id'
)
->
whereNotIn
(
'o.user_id'
,
$this
->
testMobile
())
->
where
(
'o.is_type'
,
0
)
->
where
(
'i.inv_type'
,
2
)
->
whereBetween
(
'o.create_time'
,
[
$half
,
$current
])
->
count
();
echo
'半年普票订单数:'
.
$halfInvoice
.
'<br>'
;
$yearInvoice
=
DB
::
connection
(
'order'
)
->
table
(
'lie_order as o'
)
->
leftJoin
(
'lie_order_invoice as i'
,
'o.order_id'
,
'='
,
'i.order_id'
)
->
whereNotIn
(
'o.user_id'
,
$this
->
testMobile
())
->
where
(
'o.is_type'
,
0
)
->
where
(
'i.inv_type'
,
2
)
->
whereBetween
(
'o.create_time'
,
[
$year
,
$current
])
->
count
();
echo
'一年普票订单数:'
.
$yearInvoice
.
'<br>'
;
// 增票订单数
$halfAddInvoice
=
DB
::
connection
(
'order'
)
->
table
(
'lie_order as o'
)
->
leftJoin
(
'lie_order_invoice as i'
,
'o.order_id'
,
'='
,
'i.order_id'
)
->
whereNotIn
(
'o.user_id'
,
$this
->
testMobile
())
->
where
(
'o.is_type'
,
0
)
->
where
(
'i.inv_type'
,
3
)
->
whereBetween
(
'o.create_time'
,
[
$half
,
$current
])
->
count
();
echo
'半年增票订单数:'
.
$halfAddInvoice
.
'<br>'
;
$yearAddInvoice
=
DB
::
connection
(
'order'
)
->
table
(
'lie_order as o'
)
->
leftJoin
(
'lie_order_invoice as i'
,
'o.order_id'
,
'='
,
'i.order_id'
)
->
whereNotIn
(
'o.user_id'
,
$this
->
testMobile
())
->
where
(
'o.is_type'
,
0
)
->
where
(
'i.inv_type'
,
3
)
->
whereBetween
(
'o.create_time'
,
[
$year
,
$current
])
->
count
();
echo
'一年增票订单数:'
.
$yearAddInvoice
.
'<br>'
;
}
}
\ No newline at end of file
app/Http/routes.php
View file @
e5cb40aa
...
...
@@ -71,6 +71,7 @@ Route::group(['middleware' => 'web'], function () {
Route
::
match
(
'post'
,
'/ajaxRejected'
,
'OrderController@ajaxRejected'
);
Route
::
match
([
'get'
,
'post'
],
'/express_set'
,
'OrderController@expressSet'
);
Route
::
match
([
'get'
,
'post'
],
'/tempcount'
,
'OrderController@tempCount'
);
Route
::
post
(
'/ajaxDownloadContract'
,
'OrderController@ajaxDownloadContract'
);
...
...
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