Browse Source

feat:修改了07代理列表文档

景好勇 4 months ago
parent
commit
c6ca90930a

+ 2 - 4
app/Enums/WalletType.php

@@ -34,7 +34,7 @@ enum WalletType: int
      */
     public function label(): string
     {
-        return match($this) {
+        return match ($this) {
             self::PLATFORM => '平台自有资金钱包',
             self::ESCROW => '平台代收代付钱包',
             self::PERSONAL => '个人钱包',
@@ -71,7 +71,7 @@ enum WalletType: int
      */
     public static function fromValue(int $value): ?self
     {
-        return match($value) {
+        return match ($value) {
             self::PLATFORM->value => self::PLATFORM,
             self::ESCROW->value => self::ESCROW,
             self::PERSONAL->value => self::PERSONAL,
@@ -104,6 +104,4 @@ enum WalletType: int
             self::MERCHANT->value => self::MERCHANT->label(),
         ];
     }
-
-  
 }

+ 7 - 3
doc/系统设计/数据库设计/物理模型/分析后台设计增加/07代理列表.sql

@@ -10,7 +10,6 @@
 DROP TABLE IF EXISTS report_agent_list;
 
 CREATE TABLE report_agent_list AS
-/* 代理信息统计查询 */
 /* 代理列表视图 */
 
 DROP VIEW IF EXISTS manage_agent_list;
@@ -25,7 +24,7 @@ WITH
             AND wr.audit_state = 'approved'
             AND wr.state = 'success'
         WHERE
-            w.owner_type = 'AGENT'
+            w.owner_type = '3'
         GROUP BY
             w.owner_id
     )
@@ -43,9 +42,14 @@ FROM
     agent_infos ai
     INNER JOIN member_users mu ON ai.user_id = mu.id
     LEFT JOIN wallet w ON w.owner_id = ai.id
-    AND w.owner_type = 'AGENT'
+    AND w.owner_type = '3'
     LEFT JOIN agent_withdraw aw ON aw.owner_id = mu.id
 WHERE
     ai.deleted_at IS NULL
     AND mu.deleted_at IS NULL
     AND w.deleted_at IS NULL;
+
+select *
+from
+    agent_infos as ag
+    inner join member_users as mu on ag.user_id = mu.id;