王虎 %!s(int64=6) %!d(string=hai) anos
pai
achega
4c3eb72a3b

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 1 - 0
projects/melee/json/virtual_user.json


+ 67 - 0
projects/melee/model/VirtualUser.php

@@ -0,0 +1,67 @@
+<?php
+
+class VirtualUser
+{
+    /**
+     * Returns table name mapped in the model.
+     *
+     * @return string
+     */
+    public static function getSource()
+    {
+        return 'virtual_user';
+    }
+
+    /**
+     * 获取导出给客户端所需要的字段
+     *
+     * @return array
+     */
+    public static function getToClientColumns()
+    {
+         return [];
+    }
+
+    /**
+     * 生成客户端需要的字段, 生成列表
+     *
+     * @return array
+     */
+    public static function getListForClient()
+    {
+        $data = [];
+        if (empty(self::getToClientColumns())) {
+            $data = array_values(self::getList());
+        } else {
+            foreach (self::getList() as $key => $value) {
+                foreach ($value as $k => $v) {
+                    if (!in_array($k, self::getToClientColumns())) {
+                        unset($value[$k]);
+                    }
+                }
+                $data[] = $value;
+            }
+        }
+        return $data;
+    }
+
+    /**
+     * 获取单条配置内容
+     *
+     * @return array
+     */
+    public static function get($configId)
+    {
+        return IConfig::get()->loadAppConfig(self::getSource(), $configId);
+    }
+
+    /**
+     * 获取所有配置
+     *
+     * @return array
+     */
+    public static function getList()
+    {
+        return IConfig::get()->loadAppConfig(self::getSource());
+    }
+}

A diferenza do arquivo foi suprimida porque é demasiado grande
+ 5003 - 0
projects/melee/output/virtual_user.config.php


+ 12 - 0
projects/melee/script/virtual_user.php

@@ -0,0 +1,12 @@
+<?php
+
+include APP_PATH . "/default-script.php";
+
+function virtual_user_handle($data)
+{
+    foreach ($data as &$v) {
+        unset($v['id']);
+    }
+
+    return array_values($data);
+}

BIN=BIN
projects/melee/source/虚拟用户.xlsx


+ 67 - 0
projects/test/model/ItemCopy.php

@@ -0,0 +1,67 @@
+<?php
+
+class ItemCopy
+{
+    /**
+     * Returns table name mapped in the model.
+     *
+     * @return string
+     */
+    public static function getSource()
+    {
+        return 'item_copy';
+    }
+
+    /**
+     * 获取导出给客户端所需要的字段
+     *
+     * @return array
+     */
+    public static function getToClientColumns()
+    {
+         return [];
+    }
+
+    /**
+     * 生成客户端需要的字段, 生成列表
+     *
+     * @return array
+     */
+    public static function getListForClient()
+    {
+        $data = [];
+        if (empty(self::getToClientColumns())) {
+            $data = array_values(self::getList());
+        } else {
+            foreach (self::getList() as $key => $value) {
+                foreach ($value as $k => $v) {
+                    if (!in_array($k, self::getToClientColumns())) {
+                        unset($value[$k]);
+                    }
+                }
+                $data[] = $value;
+            }
+        }
+        return $data;
+    }
+
+    /**
+     * 获取单条配置内容
+     *
+     * @return array
+     */
+    public static function get($configId)
+    {
+        return IConfig::get()->loadAppConfig(self::getSource(), $configId);
+    }
+
+    /**
+     * 获取所有配置
+     *
+     * @return array
+     */
+    public static function getList()
+    {
+        return IConfig::get()->loadAppConfig(self::getSource());
+    }
+}