小程序用户改用门店登录

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 -11
View File
@@ -9,7 +9,6 @@ use App\Models\ProductModel;
use App\Models\PurchaseOrderModel;
use App\Models\StoreModel;
use App\Models\StoreOrderModel;
use App\Models\UserModel;
use Modules\SystemTool\Models\SysFileModel;
/**
@@ -29,9 +28,8 @@ class BillPaymentTest extends ProcurementTestCase
$level = CustomerLevelModel::factory()->create();
$store = StoreModel::factory()->create(['level_id' => $level->id]);
$product = ProductModel::factory()->create(['status' => ProductModel::STATUS_ON, 'cost_price' => '5.00']);
$user = UserModel::factory()->forStore($store->id)->create();
$this->actingAsMiniUser($user);
$this->actingAsMiniStore($store);
$this->postJson('/mini/order', ['items' => [['product_id' => $product->id, 'quantity' => 4]]])
->assertJsonPath('success', true);
$order = StoreOrderModel::where('store_id', $store->id)->first();
@@ -80,9 +78,8 @@ class BillPaymentTest extends ProcurementTestCase
$level = CustomerLevelModel::factory()->create();
$store = StoreModel::factory()->create(['level_id' => $level->id]);
$product = ProductModel::factory()->create(['status' => ProductModel::STATUS_ON, 'cost_price' => '5.00']);
$user = UserModel::factory()->forStore($store->id)->create();
$this->actingAsMiniUser($user);
$this->actingAsMiniStore($store);
$this->postJson('/mini/order', ['items' => [['product_id' => $product->id, 'quantity' => 4]]])
->assertJsonPath('success', true);
$order = StoreOrderModel::where('store_id', $store->id)->first();
@@ -144,12 +141,10 @@ class BillPaymentTest extends ProcurementTestCase
public function test_payment_audit_pass_accumulates_store_total_purchase_amount(): void
{
$store = StoreModel::factory()->create();
$user = UserModel::factory()->forStore($store->id)->create();
$payment = PaymentModel::create([
'payment_no' => 'ZF202608140001',
'store_id' => $store->id,
'user_id' => $user->id,
'amount' => '150.00',
'pay_method' => PaymentModel::METHOD_BANK,
'voucher_ids' => '',
@@ -176,12 +171,10 @@ class BillPaymentTest extends ProcurementTestCase
public function test_payment_audit_reject_does_not_accumulate(): void
{
$store = StoreModel::factory()->create();
$user = UserModel::factory()->forStore($store->id)->create();
$payment = PaymentModel::create([
'payment_no' => 'ZF202608140002',
'store_id' => $store->id,
'user_id' => $user->id,
'amount' => '100.00',
'pay_method' => PaymentModel::METHOD_WECHAT,
'voucher_ids' => '',
@@ -234,7 +227,6 @@ class BillPaymentTest extends ProcurementTestCase
public function test_payment_detail_returns_voucher_urls(): void
{
$store = StoreModel::factory()->create();
$user = UserModel::factory()->forStore($store->id)->create();
$makeFile = static function (string $path): int {
return (int) SysFileModel::create([
@@ -255,7 +247,6 @@ class BillPaymentTest extends ProcurementTestCase
$payment = PaymentModel::create([
'payment_no' => 'ZF202608140003',
'store_id' => $store->id,
'user_id' => $user->id,
'amount' => '100.00',
'pay_method' => PaymentModel::METHOD_BANK,
'voucher_ids' => [$fileA, $fileB],