小程序用户改用门店登录

This commit is contained in:
liu
2026-08-20 13:46:04 +08:00
parent 6d9f02d831
commit c1d490134e
251 changed files with 689 additions and 2727 deletions
+2 -14
View File
@@ -9,7 +9,6 @@ use App\Models\ProductModel;
use App\Models\PurchaseOrderModel;
use App\Models\StoreModel;
use App\Models\StoreOrderItemModel;
use App\Models\UserModel;
use Maatwebsite\Excel\Facades\Excel;
/**
@@ -219,7 +218,7 @@ class BillExportTest extends ProcurementTestCase
}
/** 小程序端导出:强制本店过滤,混入他店账单整批拒绝 */
public function test_mini_export_scoped_to_bound_store(): void
public function test_mini_export_scoped_to_own_store(): void
{
$this->freezeTime();
@@ -233,8 +232,7 @@ class BillExportTest extends ProcurementTestCase
$this->makeItem($billA, $product, 10, '2.00');
$this->makeItem($billB, $product, 5, '20.00');
$user = UserModel::factory()->forStore($storeA->id)->create();
$this->actingAsMiniUser($user);
$this->actingAsMiniStore($storeA);
// 本店账单正常导出
Excel::fake();
@@ -256,14 +254,4 @@ class BillExportTest extends ProcurementTestCase
$this->get("/mini/bill/export?ids={$billB->id}")
->assertJsonPath('success', false);
}
/** 小程序端导出:未绑定门店 → 拒绝 */
public function test_mini_export_requires_store_binding(): void
{
$user = UserModel::factory()->create();
$this->actingAsMiniUser($user);
$this->get('/mini/bill/export?ids=1')
->assertJsonPath('success', false);
}
}