小程序用户改用门店登录

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
+5 -8
View File
@@ -11,7 +11,6 @@ use App\Models\StoreModel;
use App\Models\StoreOrderItemModel;
use App\Models\StoreOrderModel;
use App\Models\SupplierModel;
use App\Models\UserModel;
/**
* 仪表盘分析页聚合接口:权限校验、指标口径(排除已取消)、趋势补日、排行与对账概览
@@ -262,7 +261,6 @@ class DashboardTest extends ProcurementTestCase
PaymentModel::create([
'payment_no' => 'ZF' . random_int(100000000000, 999999999999),
'store_id' => $store->id,
'user_id' => 0,
'amount' => '88.00',
'pay_method' => PaymentModel::METHOD_WECHAT,
'status' => PaymentModel::STATUS_PENDING,
@@ -302,7 +300,7 @@ class DashboardTest extends ProcurementTestCase
$this->assertSame('已完成', $latest[0]['status_name']);
}
/** 基础档案仅统计启用中的门店/商品/供应商/用户 */
/** 基础档案仅统计启用中的门店/商品/供应商 */
public function test_archives_count_active_records_only(): void
{
StoreModel::factory()->count(2)->create(['status' => StoreModel::STATUS_NORMAL]);
@@ -311,15 +309,14 @@ class DashboardTest extends ProcurementTestCase
ProductModel::factory()->create(['status' => ProductModel::STATUS_OFF]);
SupplierModel::factory()->create(['status' => SupplierModel::STATUS_NORMAL]);
SupplierModel::factory()->create(['status' => SupplierModel::STATUS_DISABLED]);
UserModel::factory()->count(2)->create(['status' => UserModel::STATUS_NORMAL]);
UserModel::factory()->create(['status' => UserModel::STATUS_DISABLED]);
$this->actingAsSysUser(['dashboard.analysis']);
$this->getJson(self::ROUTE)
$response = $this->getJson(self::ROUTE)
->assertOk()
->assertJsonPath('data.archives.stores', 2)
->assertJsonPath('data.archives.products', 3)
->assertJsonPath('data.archives.suppliers', 1)
->assertJsonPath('data.archives.users', 2);
->assertJsonPath('data.archives.suppliers', 1);
$this->assertArrayNotHasKey('users', $response->json('data.archives'), '档案计数不再返回 users 键(与门店数重复)');
}
}