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
f586269c
authored
Aug 16, 2019
by
朱继来
Browse files
Options
_('Browse Files')
Download
Plain Diff
Merge branch 'zjl_order_track_20190815' into development
parents
3993ec31
a3c6eed7
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
113 additions
and
4 deletions
app/Http/Controllers/ApiController.php
app/Http/Controllers/OrderController.php
app/Http/routes.php
app/Model/OrderItemsTrackModel.php
public/js/order.js
resources/views/detail/content.blade.php
app/Http/Controllers/ApiController.php
View file @
f586269c
...
@@ -2,15 +2,14 @@
...
@@ -2,15 +2,14 @@
namespace
App\Http\Controllers
;
namespace
App\Http\Controllers
;
use
App\Http\Requests
;
use
App\Http\Controllers\Controller
;
use
Illuminate\Http\Request
;
use
App\Model\PaymentDaysModel
;
use
App\Model\PaymentDaysModel
;
use
App\Model\Pcb\PcbOrderModel
;
use
App\Model\Pcb\PcbOrderModel
;
use
App\Model\Pcb\PcbPublicModel
;
use
App\Model\Pcb\PcbPublicModel
;
use
App\Model\Pcb\PcbPurchaseModel
;
use
App\Model\Pcb\PcbPurchaseModel
;
use
App\Model\Pcb\PcbServerModel
;
use
App\Model\Pcb\PcbServerModel
;
use
Illuminate\Http\Request
;
use
App\Http\Requests
;
use
App\Http\Controllers\Controller
;
class
ApiController
extends
Controller
class
ApiController
extends
Controller
{
{
...
...
app/Http/Controllers/OrderController.php
View file @
f586269c
...
@@ -16,6 +16,7 @@ use App\Model\OrderModel;
...
@@ -16,6 +16,7 @@ use App\Model\OrderModel;
use
App\Model\UserMainModel
;
use
App\Model\UserMainModel
;
use
App\Model\OrderActionLogModel
;
use
App\Model\OrderActionLogModel
;
use
App\Model\OrderReturnModel
;
use
App\Model\OrderReturnModel
;
use
App\Model\OrderItemsTrackModel
;
// 获取订单优惠券金额
// 获取订单优惠券金额
function
getCoupon
(
$order_id
)
function
getCoupon
(
$order_id
)
...
@@ -285,6 +286,17 @@ function getOrderExtend($order_id, $field="*", $where=array())
...
@@ -285,6 +286,17 @@ function getOrderExtend($order_id, $field="*", $where=array())
return
$extend
;
return
$extend
;
}
}
// 获取订单跟踪
function
getLastTrack
(
$rec_id
)
{
$OrderItemsTrackModel
=
new
OrderItemsTrackModel
;
$track
=
$OrderItemsTrackModel
->
getLastItemTrack
(
$rec_id
);
if
(
!
$track
)
return
false
;
return
$track
[
'track_content'
]
.
',数量:'
.
$track
[
'track_num'
];
}
Class
OrderController
extends
Controller
Class
OrderController
extends
Controller
{
{
// 首页
// 首页
...
@@ -1724,6 +1736,19 @@ Class OrderController extends Controller
...
@@ -1724,6 +1736,19 @@ Class OrderController extends Controller
}
}
}
}
// 获取订单明细跟踪
public
function
getOrderItemsTrack
(
Request
$request
)
{
if
(
$request
->
isMethod
(
'post'
))
{
$rec_id
=
$request
->
input
(
'rec_id'
);
$OrderItemsTrackModel
=
new
OrderItemsTrackModel
;
$data
=
$OrderItemsTrackModel
->
getOrderItemsTrack
(
$rec_id
);
return
[
'errcode'
=>
0
,
'errmsg'
=>
'成功'
,
'data'
=>
$data
];
}
}
public
function
tempCount
(
Request
$request
)
public
function
tempCount
(
Request
$request
)
{
{
$current
=
strtotime
(
date
(
'Y-m-d'
,
time
()));
// 当天0点
$current
=
strtotime
(
date
(
'Y-m-d'
,
time
()));
// 当天0点
...
...
app/Http/routes.php
View file @
f586269c
...
@@ -136,6 +136,7 @@ Route::group(['middleware' => 'web'], function () {
...
@@ -136,6 +136,7 @@ Route::group(['middleware' => 'web'], function () {
Route
::
post
(
'/ajax/addGoods'
,
'AddOrderController@addGoods'
);
Route
::
post
(
'/ajax/addGoods'
,
'AddOrderController@addGoods'
);
Route
::
post
(
'/ajax/uploadContract'
,
'OrderController@uploadContract'
);
Route
::
post
(
'/ajax/uploadContract'
,
'OrderController@uploadContract'
);
Route
::
post
(
'/ajax/getOrderItemsTrack'
,
'OrderController@getOrderItemsTrack'
);
});
});
// 不需要登陆态
// 不需要登陆态
...
...
app/Model/OrderItemsTrackModel.php
0 → 100644
View file @
f586269c
<?php
namespace
App\Model
;
use
Illuminate\Database\Eloquent\Model
;
use
Request
;
use
Excel
;
use
DB
;
class
OrderItemsTrackModel
extends
Model
{
protected
$connection
=
'order'
;
protected
$table
=
'lie_order_items_track'
;
protected
$primaryKey
=
'track_items_id'
;
protected
$guarded
=
[
'amount_id'
];
public
$timestamps
=
true
;
const
CREATED_AT
=
'create_time'
;
public
function
fromDateTime
(
$value
)
{
return
strtotime
(
parent
::
fromDateTime
(
$value
));
}
// 获取最新的明细跟踪
public
function
getLastItemTrack
(
$rec_id
)
{
return
$this
->
where
(
'rec_id'
,
$rec_id
)
->
select
(
'track_items_id'
,
'order_id'
,
'track_content'
,
'track_num'
,
'create_name'
,
'create_time'
)
->
orderBy
(
'create_time'
,
'desc'
)
->
first
();
}
// 获取所有明细跟踪
public
function
getOrderItemsTrack
(
$rec_id
)
{
return
$this
->
where
(
'rec_id'
,
$rec_id
)
->
select
(
'track_items_id'
,
'order_id'
,
'track_content'
,
'track_num'
,
'create_name'
,
'create_time'
)
->
orderBy
(
'create_time'
,
'desc'
)
->
get
();
}
}
\ No newline at end of file
public/js/order.js
View file @
f586269c
...
@@ -756,6 +756,46 @@
...
@@ -756,6 +756,46 @@
})
})
})
})
// 查看订单明细跟踪
$
(
'.order-track'
).
click
(
function
()
{
var
rid
=
$
(
this
).
data
(
'rid'
);
$
.
ajax
({
url
:
'/ajax/getOrderItemsTrack'
,
type
:
'post'
,
data
:
{
rec_id
:
rid
},
success
:
function
(
resp
)
{
if
(
resp
.
errcode
==
0
)
{
var
data
=
resp
.
data
;
var
content
=
'<table class="table">\
<tr>\
<th width="30%">时间</th>\
<th>说明</th>\
<th width="13%">负责人</th>\
</tr>'
;
for
(
var
i
=
0
;
i
<
data
.
length
;
i
++
)
{
content
+=
'<tr><td>'
+
data
[
i
].
create_time
+
'</td><td>'
+
data
[
i
].
track_content
+
',数量:'
+
data
[
i
].
track_num
+
'</td><td>'
+
data
[
i
].
create_name
+
'</td></tr>'
;
}
content
+=
'</table>'
;
layer
.
open
({
title
:
'订单明细跟踪'
,
area
:
[
'600px'
,
'400px'
],
content
:
content
,
btn
:
[],
})
}
else
{
layer
.
alert
(
resp
.
errmsg
||
'网络异常'
);
}
},
error
:
function
(
err
)
{
console
.
log
(
err
);
}
})
})
// 点击物流展开
// 点击物流展开
$
(
'.click-down'
).
click
(
function
()
{
$
(
'.click-down'
).
click
(
function
()
{
$
(
this
).
parents
(
'tbody'
).
find
(
'.other-infos'
).
show
();
$
(
this
).
parents
(
'tbody'
).
find
(
'.other-infos'
).
show
();
...
...
resources/views/detail/content.blade.php
View file @
f586269c
...
@@ -476,6 +476,10 @@
...
@@ -476,6 +476,10 @@
<th>
供应商
</th>
<th>
供应商
</th>
@endif
@endif
@if ($order_info['order_goods_type'] == 1)
<th>
生产跟踪
</th>
@endif
<?php
<?php
if
(
$action_name
==
'changeOrder'
&&
count
(
$order_items_info
)
>
1
&&
in_array
(
$order_info
[
'status'
],
[
1
,
2
]))
{
if
(
$action_name
==
'changeOrder'
&&
count
(
$order_items_info
)
>
1
&&
in_array
(
$order_info
[
'status'
],
[
1
,
2
]))
{
echo
'<th>操作</th>'
;
echo
'<th>操作</th>'
;
...
@@ -516,6 +520,10 @@
...
@@ -516,6 +520,10 @@
<td>
{{$v['supplier_name']}}
</td>
<td>
{{$v['supplier_name']}}
</td>
@endif
@endif
@if ($order_info['order_goods_type'] == 1)
<th><a
class=
"order-track"
data-rid=
"{{$v['rec_id']}}"
>
{{ App\Http\Controllers\getLastTrack($v['rec_id']) }}
</a></th>
@endif
@if ($action_name == 'changeOrder'
&&
count($order_items_info) > 1
&&
in_array($order_info['status'], [1, 2]))
@if ($action_name == 'changeOrder'
&&
count($order_items_info) > 1
&&
in_array($order_info['status'], [1, 2]))
<td><a
class=
"btn btn-danger deletegoods"
href=
"javascript:;"
data-id=
"{{$v['rec_id']}}"
>
删除
</a></td>
<td><a
class=
"btn btn-danger deletegoods"
href=
"javascript:;"
data-id=
"{{$v['rec_id']}}"
>
删除
</a></td>
@endif
@endif
...
...
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