feat: #10000 订单展示
This commit is contained in:
parent
5295a48576
commit
9ea6d58df7
@ -11,6 +11,31 @@ class BusinessOrderFilter extends Filters
|
|||||||
|
|
||||||
protected function shopId($value)
|
protected function shopId($value)
|
||||||
{
|
{
|
||||||
return $this->builder->where('shop_id', '=', trim($value));
|
return $this->builder->where('shop_id', '=', $value);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function activityNo($value)
|
||||||
|
{
|
||||||
|
return $this->builder->where('activity_no', '=', $value);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function shippingStatus($value)
|
||||||
|
{
|
||||||
|
return $this->builder->where('shipping_status', '=', $value);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function isSupplier($value)
|
||||||
|
{
|
||||||
|
return $this->builder->where('is_supplier', '=', $value);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function cancelStatus($value)
|
||||||
|
{
|
||||||
|
return $this->builder->where('cancel_status', '=', $value);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function afterSalesStatus($value)
|
||||||
|
{
|
||||||
|
return $this->builder->where('after_sales_status', '=', $value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,8 +14,13 @@ class BusinessOrderController extends Controller
|
|||||||
public function index(Request $request)
|
public function index(Request $request)
|
||||||
{
|
{
|
||||||
$businessOrders = BusinessOrder::query()
|
$businessOrders = BusinessOrder::query()
|
||||||
|
->where('shop_id', '<>', 8)
|
||||||
|
->with([
|
||||||
|
'shop:id,name',
|
||||||
|
'items:id,business_order_id,goods_name,goods_number'
|
||||||
|
])
|
||||||
|
->orderByDesc('confirm_at')
|
||||||
->filter()
|
->filter()
|
||||||
->with(['shop:id,name'])
|
|
||||||
->paginate($request->get('per_page'));
|
->paginate($request->get('per_page'));
|
||||||
|
|
||||||
return BusinessOrderResource::collection($businessOrders);
|
return BusinessOrderResource::collection($businessOrders);
|
||||||
|
|||||||
@ -10,7 +10,12 @@ class BusinessOrder extends Model
|
|||||||
|
|
||||||
public $fieldSearchable = [
|
public $fieldSearchable = [
|
||||||
'participate_no',
|
'participate_no',
|
||||||
'shop_id'
|
'shop_id',
|
||||||
|
'activity_no',
|
||||||
|
'shipping_status',
|
||||||
|
'is_supplier',
|
||||||
|
'cancel_status',
|
||||||
|
'after_sales_status',
|
||||||
];
|
];
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
@ -50,6 +55,39 @@ class BusinessOrder extends Model
|
|||||||
'order_sn',
|
'order_sn',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
public function getConfirmAtAttribute($value)
|
||||||
|
{
|
||||||
|
return date('Y-m-d H:i:s', $value / 1000);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getShippingStatusAttribute($value)
|
||||||
|
{
|
||||||
|
$map = ['未发货', '已发货', '部分发货'];
|
||||||
|
|
||||||
|
return $map[$value];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getIsSupplierAttribute($value)
|
||||||
|
{
|
||||||
|
$map = ['帮忙团订单', '自卖团订单'];
|
||||||
|
|
||||||
|
return $map[$value];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getCancelStatusAttribute($value)
|
||||||
|
{
|
||||||
|
$map = ['未取消', '已取消'];
|
||||||
|
|
||||||
|
return $map[$value];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getAfterSalesStatusAttribute($value)
|
||||||
|
{
|
||||||
|
$map = ['未售后', '有售后'];
|
||||||
|
|
||||||
|
return $map[$value];
|
||||||
|
}
|
||||||
|
|
||||||
public function items()
|
public function items()
|
||||||
{
|
{
|
||||||
return $this->hasMany(BusinessOrderItem::class, 'business_order_id');
|
return $this->hasMany(BusinessOrderItem::class, 'business_order_id');
|
||||||
|
|||||||
@ -18,6 +18,7 @@ class MenusTableSeeder extends Seeder
|
|||||||
['parent_id' => $id, 'code' => 'GOODS_LIST', 'name' => '商品列表', 'seq' => 0],
|
['parent_id' => $id, 'code' => 'GOODS_LIST', 'name' => '商品列表', 'seq' => 0],
|
||||||
['parent_id' => $id, 'code' => 'GOODS_TYPE', 'name' => '商品种类', 'seq' => 1],
|
['parent_id' => $id, 'code' => 'GOODS_TYPE', 'name' => '商品种类', 'seq' => 1],
|
||||||
['parent_id' => $id, 'code' => 'GOODS_BRAND', 'name' => '商品品牌', 'seq' => 2],
|
['parent_id' => $id, 'code' => 'GOODS_BRAND', 'name' => '商品品牌', 'seq' => 2],
|
||||||
|
['parent_id' => $id, 'code' => 'GOODS_SKU_LOCATION', 'name' => '商品货架', 'seq' => 3],
|
||||||
]);
|
]);
|
||||||
// 店铺管理
|
// 店铺管理
|
||||||
DB::table('menus')->insertGetId(['parent_id' => 0, 'code' => 'SHOP_MANAGE', 'name' => '店铺管理', 'seq' => 10]);
|
DB::table('menus')->insertGetId(['parent_id' => 0, 'code' => 'SHOP_MANAGE', 'name' => '店铺管理', 'seq' => 10]);
|
||||||
|
|||||||
@ -11,7 +11,8 @@
|
|||||||
|
|
||||||
<el-form-item label="活动名称:">
|
<el-form-item label="活动名称:">
|
||||||
<el-select v-model="form.activity_no" placeholder="活动名称">
|
<el-select v-model="form.activity_no" placeholder="活动名称">
|
||||||
<el-option v-for="item in groupActivity" :key="item.activity_no" :label="item.activity_title" :value="item.activity_no">
|
<el-option v-for="item in groupActivity" :key="item.activity_no" :label="item.activity_title"
|
||||||
|
:value="item.activity_no">
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -25,16 +26,11 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<el-form-item label="选择时间:">
|
|
||||||
<el-input v-model="form.confirm_at" placeholder="选择时间">
|
|
||||||
</el-input>
|
|
||||||
</el-form-item>
|
|
||||||
|
|
||||||
<el-form-item label="订单类型:">
|
<el-form-item label="订单类型:">
|
||||||
<el-select v-model="form.is_help" placeholder="订单类型">
|
<el-select v-model="form.is_supplier" placeholder="订单类型">
|
||||||
<el-option value="" label="全部订单"></el-option>
|
<el-option value="" label="全部订单"></el-option>
|
||||||
<el-option value="0" label="自卖团订单"></el-option>
|
<el-option value="1" label="自卖团订单"></el-option>
|
||||||
<el-option value="1" label="帮忙团订单"></el-option>
|
<el-option value="0" label="帮忙团订单"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
@ -69,8 +65,17 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="activity_title" label="活动名称"></el-table-column>
|
<el-table-column prop="activity_title" label="活动名称"></el-table-column>
|
||||||
|
<el-table-column prop="shipping_status" label="发货状态"></el-table-column>
|
||||||
|
<el-table-column prop="is_supplier" label="订单类型"></el-table-column>
|
||||||
|
<el-table-column prop="cancel_status" label="订单状态"></el-table-column>
|
||||||
|
<el-table-column prop="after_sales_status" label="售后状态"></el-table-column>
|
||||||
<el-table-column prop="participate_no" label="跟团号"></el-table-column>
|
<el-table-column prop="participate_no" label="跟团号"></el-table-column>
|
||||||
<el-table-column prop="items_info" label="商品信息"></el-table-column>
|
<el-table-column label="商品信息">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<div v-for="item in scope.row.items" :key="item.id">{{ item.goods_name }}*{{ item.goods_number }}
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column prop="confirm_at" label="下单时间"></el-table-column>
|
<el-table-column prop="confirm_at" label="下单时间"></el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
@ -95,8 +100,7 @@ export default {
|
|||||||
shop_id: "",
|
shop_id: "",
|
||||||
activity_no: "",
|
activity_no: "",
|
||||||
shipping_status: "",
|
shipping_status: "",
|
||||||
confirm_at: "",
|
is_supplier: "",
|
||||||
is_help: "",
|
|
||||||
cancel_status: "",
|
cancel_status: "",
|
||||||
after_sales_status: "",
|
after_sales_status: "",
|
||||||
},
|
},
|
||||||
@ -163,8 +167,7 @@ export default {
|
|||||||
shop_id: "",
|
shop_id: "",
|
||||||
activity_no: "",
|
activity_no: "",
|
||||||
shipping_status: "",
|
shipping_status: "",
|
||||||
confirm_at: "",
|
is_supplier: "",
|
||||||
is_help: "",
|
|
||||||
cancel_status: "",
|
cancel_status: "",
|
||||||
after_sales_status: "",
|
after_sales_status: "",
|
||||||
};
|
};
|
||||||
|
|||||||
@ -48,7 +48,7 @@ Route::middleware(['auth:api', 'check.permissions'])->group(function () {
|
|||||||
]]);
|
]]);
|
||||||
// 平台
|
// 平台
|
||||||
Route::resource('plat_goods', 'Business\BusinessGoodsSkusController', ['only' => ['index', 'update', 'destroy']]);
|
Route::resource('plat_goods', 'Business\BusinessGoodsSkusController', ['only' => ['index', 'update', 'destroy']]);
|
||||||
Route::get('plat_orders', [BusinessOrderController::class, 'index'])->name('plat_orders.index');
|
Route::get('plat_orders', [BusinessOrderController::class, 'index'])->name('plat.orders.index');
|
||||||
Route::get('plat_orders/export', [BusinessOrderController::class, 'exportOrderBlank'])->name('plat.orders.export');
|
Route::get('plat_orders/export', [BusinessOrderController::class, 'exportOrderBlank'])->name('plat.orders.export');
|
||||||
Route::get('plat_group_activity/{shopId}', [BusinessOrderController::class, 'groupActivity'])->name('plat.activity.list');
|
Route::get('plat_group_activity/{shopId}', [BusinessOrderController::class, 'groupActivity'])->name('plat.activity.list');
|
||||||
Route::post('plat/sync/{id}/stock', [BusinessGoodsSkusController::class, 'syncStock'])->name('plat.sync.stock');
|
Route::post('plat/sync/{id}/stock', [BusinessGoodsSkusController::class, 'syncStock'])->name('plat.sync.stock');
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user