配送订单状态列表
This commit is contained in:
parent
a5b83d5103
commit
9a5cda0dba
@ -188,4 +188,28 @@ class Logistics extends BaseController
|
||||
$latestTenOrder = Db::connect('logistics')->name('logistics')->field('receiver_address')->where(['status'=>1, 'courier_id' => $courierId])->order('id', 'desc')->limit(10)->select()->toArray();
|
||||
return app('json')->success(compact('latestOrder', 'latestTenOrder'));
|
||||
}
|
||||
|
||||
public function logisticsList()
|
||||
{
|
||||
$type = $this->request->param('type');
|
||||
$courierId = $this->request->param('courier_id');
|
||||
$list = [];
|
||||
$count = 0;
|
||||
if ($type == 1) {
|
||||
// 待取货
|
||||
$list = Db::connect('logistics')->name('logistics')->where(['status'=>0, 'courier_id'=>$courierId])->select();
|
||||
$count = Db::connect('logistics')->name('logistics')->where(['status'=>0, 'courier_id'=>$courierId])->count();
|
||||
}
|
||||
if ($type == 2) {
|
||||
// 配送中
|
||||
$list = Db::connect('logistics')->name('logistics')->where(['status'=>1, 'courier_id'=>$courierId])->select();
|
||||
$count = Db::connect('logistics')->name('logistics')->where(['status'=>1, 'courier_id'=>$courierId])->count();
|
||||
}
|
||||
if ($type == 3) {
|
||||
// 已完成
|
||||
$list = Db::connect('logistics')->name('logistics')->where([['status', 'in', [2,3]], 'courier_id'=>$courierId])->select();
|
||||
$count = Db::connect('logistics')->name('logistics')->where([['status', 'in', [2,3]], 'courier_id'=>$courierId])->count();
|
||||
}
|
||||
return app('json')->success(compact('count', 'list'));
|
||||
}
|
||||
}
|
@ -727,6 +727,7 @@ Route::group('api/', function () {
|
||||
Route::get('latest_logistics', 'Logistics/latestLogistics');
|
||||
Route::get('logistics_count', 'Logistics/logisticsCount');
|
||||
Route::get('logistics_map_count', 'Logistics/logisticsMapCount');
|
||||
Route::get('logistics_list', 'Logistics/logisticsList');
|
||||
/**---------------------物流溯源监控大屏api---------------------- end **/
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user