diff --git a/app/Http/Controllers/Goods/GoodsSkuLocationController.php b/app/Http/Controllers/Goods/GoodsSkuLocationController.php index f91d21d..f83d10c 100644 --- a/app/Http/Controllers/Goods/GoodsSkuLocationController.php +++ b/app/Http/Controllers/Goods/GoodsSkuLocationController.php @@ -54,7 +54,7 @@ class GoodsSkuLocationController extends Controller return response()->json($this->res); } - public function importLocation(Request $request) + public function import(Request $request) { if (!$request->hasFile('goodsSkuLocation')) { $this->res = [ diff --git a/app/Models/BusinessOrder.php b/app/Models/BusinessOrder.php index 818af0c..16bd1df 100644 --- a/app/Models/BusinessOrder.php +++ b/app/Models/BusinessOrder.php @@ -2,8 +2,12 @@ namespace App\Models; +use App\Models\traits\Filter; + class BusinessOrder extends Model { + use Filter; + public $fieldSearchable = [ 'participate_no', 'shop_id' diff --git a/database/migrations/2022_08_05_093629_create_business_orders_table.php b/database/migrations/2022_08_05_093629_create_business_orders_table.php index 3398bed..31481fa 100644 --- a/database/migrations/2022_08_05_093629_create_business_orders_table.php +++ b/database/migrations/2022_08_05_093629_create_business_orders_table.php @@ -57,6 +57,8 @@ class CreateBusinessOrdersTable extends Migration $table->timestamps(); // 索引 $table->unique(['shop_id', 'order_sn']); + $table->index(['shop_id', 'participate_no']); + $table->index(['shop_id', 'confirm_at', 'after_sales_status', 'cancel_status', 'is_supplier']); }); } diff --git a/database/migrations/2023_04_03_165820_create_goods_sku_locations_table.php b/database/migrations/2023_04_03_165820_create_goods_sku_locations_table.php index cb56e8c..d7b2c17 100644 --- a/database/migrations/2023_04_03_165820_create_goods_sku_locations_table.php +++ b/database/migrations/2023_04_03_165820_create_goods_sku_locations_table.php @@ -25,6 +25,8 @@ class CreateGoodsSkuLocationsTable extends Migration $table->tinyInteger('status')->default(1); $table->string('note')->nullable(); $table->timestamps(); + + $table->unique('external_sku_id', 'location'); }); } diff --git a/resources/lang/zh-CN/permission.php b/resources/lang/zh-CN/permission.php index b689c81..efdc9dc 100644 --- a/resources/lang/zh-CN/permission.php +++ b/resources/lang/zh-CN/permission.php @@ -122,6 +122,31 @@ return [ 'name' => '删除', 'parent_id' => 4, ], + 'GOODS_SKU_LOCATION' => [ + 'id' => 15, + 'name' => '商品货架', + 'parent_id' => 1, + ], + 'goods_sku_location.index' => [ + 'id' => 150, + 'name' => '列表', + 'parent_id' => 15, + ], + 'goods_sku_location.import' => [ + 'id' => 151, + 'name' => '导入', + 'parent_id' => 15, + ], + 'goods_sku_location.update' => [ + 'id' => 152, + 'name' => '更新', + 'parent_id' => 15, + ], + 'goods_sku_location.destroy' => [ + 'id' => 153, + 'name' => '删除', + 'parent_id' => 15, + ], // 店铺管理 'SHOP_MANAGE' => [ 'id' => 5, @@ -282,16 +307,26 @@ return [ 'name' => '同步库存', 'parent_id' => 120, ], + 'plat.activity.list' => [ + 'id' => 1204, + 'name' => '团购活动列表', + 'parent_id' => 120, + ], 'PLAT_ORDER_LIST' => [ 'id' => 14, 'name' => '订单列表', 'parent_id' => 12, ], - 'plat_orders.index' => [ + 'plat.orders.index' => [ 'id' => 140, 'name' => '订单列表', 'parent_id' => 14, ], + 'plat.orders.export' => [ + 'id' => 1400, + 'name' => '配货单导出', + 'parent_id' => 140, + ], // 团购管理 'GROUP_MANAGEMENT' => [ 'id' => 13, diff --git a/routes/api.php b/routes/api.php index 1cdde12..2cd54b1 100644 --- a/routes/api.php +++ b/routes/api.php @@ -8,6 +8,7 @@ use App\Http\Controllers\Goods\GoodsSkusController; use App\Http\Controllers\Business\BusinessGoodsSkusController; use App\Http\Controllers\Group\GroupsController; use App\Http\Controllers\Business\BusinessOrderController; +use App\Http\Controllers\Goods\GoodsSkuLocationController; /* |-------------------------------------------------------------------------- @@ -47,11 +48,17 @@ Route::middleware(['auth:api', 'check.permissions'])->group(function () { ]]); // 平台 Route::resource('plat_goods', 'Business\BusinessGoodsSkusController', ['only' => ['index', 'update', 'destroy']]); - Route::get('plat_orders', [BusinessOrderController::class, 'index']); - Route::get('plat_group_activity/{shopId}', [BusinessOrderController::class, 'groupActivity']); + 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_group_activity/{shopId}', [BusinessOrderController::class, 'groupActivity'])->name('plat.activity.list'); Route::post('plat/sync/{id}/stock', [BusinessGoodsSkusController::class, 'syncStock'])->name('plat.sync.stock'); // 团购 Route::resource('group', 'Group\GroupsController', ['only' => ['index', 'store', 'show', 'update', 'destroy']]); + // 商品货架 + Route::get('goods_sku_location', [GoodsSkuLocationController::class, 'index'])->name('goods_sku_location.index'); + Route::post('goods_sku_location', [GoodsSkuLocationController::class, 'import'])->name('goods_sku_location.import'); + Route::put('goods_sku_location', [GoodsSkuLocationController::class, 'update'])->name('goods_sku_location.update'); + Route::delete('goods_sku_location', [GoodsSkuLocationController::class, 'delete'])->name('goods_sku_location.delete'); }); // 登录 Route::post('/auth/login', [LoginController::class, 'login'])->name('auth.login'); @@ -76,5 +83,4 @@ Route::post('business', [ShopsController::class, 'business'])->name('shop.put.bu // 盘点导入 Route::post('inventory/goods_skus', [GoodsSkusController::class, 'inventoryImport'])->name('goods_sku.inventory'); - Route::post('upload', [UploadController::class, 'store'])->name('upload.file');