diff --git a/app/admin/lists/goods/GoodsclassLists.php b/app/admin/lists/goods/GoodsclassLists.php index e8145c4..9560cad 100644 --- a/app/admin/lists/goods/GoodsclassLists.php +++ b/app/admin/lists/goods/GoodsclassLists.php @@ -42,13 +42,21 @@ class GoodsclassLists extends BaseAdminDataLists implements ListsSearchInterface */ public function lists(): array { - $lists= Goodsclass::where($this->searchWhere) + $lists = Goodsclass::where($this->searchWhere) + ->where('pid', 0) ->field(['id', 'pid', 'name', 'data', 'pic', 'sort']) ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) - ->select() - ->toArray(); - return linear_to_tree($lists, 'children'); + ->select()->each(function ($item) { + $a = Goodsclass::where('pid', $item['id'])->field(['id', 'pid', 'name', 'data', 'pic', 'sort'])->select(); + $item['children'] = $a; + foreach ($a as $k => &$v) { + $b = Goodsclass::where('pid', $v['id'])->field(['id', 'pid', 'name', 'data', 'pic', 'sort'])->select(); + $v['children'] = $b; + } + })->toArray(); + return $lists; + // return linear_to_tree($lists, 'children'); } @@ -61,7 +69,8 @@ class GoodsclassLists extends BaseAdminDataLists implements ListsSearchInterface */ public function count(): int { - return Goodsclass::where($this->searchWhere)->count(); + return Goodsclass::where($this->searchWhere)->where('pid', 0) + ->count(); } } \ No newline at end of file diff --git a/app/api/lists/goods/GoodsclassLists.php b/app/api/lists/goods/GoodsclassLists.php index 51dee0a..716f2e8 100644 --- a/app/api/lists/goods/GoodsclassLists.php +++ b/app/api/lists/goods/GoodsclassLists.php @@ -42,13 +42,21 @@ class GoodsclassLists extends BaseAdminDataLists implements ListsSearchInterface */ public function lists(): array { - $lists= Goodsclass::where($this->searchWhere) + $lists = Goodsclass::where($this->searchWhere) + ->where('pid', 0) ->field(['id', 'pid', 'name', 'data', 'pic', 'sort']) ->limit($this->limitOffset, $this->limitLength) ->order(['id' => 'desc']) - ->select() - ->toArray(); - return linear_to_tree($lists, 'children'); + ->select()->each(function ($item) { + $a = Goodsclass::where('pid', $item['id'])->field(['id', 'pid', 'name', 'data', 'pic', 'sort'])->select(); + $item['children'] = $a; + foreach ($a as $k => &$v) { + $b = Goodsclass::where('pid', $v['id'])->field(['id', 'pid', 'name', 'data', 'pic', 'sort'])->select(); + $v['children'] = $b; + } + })->toArray(); + return $lists; + // return linear_to_tree($lists, 'children'); } @@ -61,7 +69,8 @@ class GoodsclassLists extends BaseAdminDataLists implements ListsSearchInterface */ public function count(): int { - return Goodsclass::where($this->searchWhere)->count(); + return Goodsclass::where($this->searchWhere)->where('pid', 0) + ->count(); } } \ No newline at end of file diff --git a/composer.lock b/composer.lock index c4ef3c9..8e48729 100644 --- a/composer.lock +++ b/composer.lock @@ -7366,5 +7366,5 @@ "ext-json": "*" }, "platform-dev": [], - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.6.0" } diff --git a/composer.phar b/composer.phar deleted file mode 100755 index 53f8b81..0000000 Binary files a/composer.phar and /dev/null differ diff --git a/config/payment.php b/config/payment.php index 1ce5cde..d855b9a 100644 --- a/config/payment.php +++ b/config/payment.php @@ -1,4 +1,5 @@ 'MIIEpAIBAAKCxxxxxxxxxxxxxxP4r3m4OUmD/+XDgCg==', // 必填-应用公钥证书 路径 - 'app_public_cert_path' => base_path().'/payment/appCertPublicKey_2016090900470841.crt', + 'app_public_cert_path' => base_path() . '/payment/appCertPublicKey_2016090900470841.crt', // 必填-支付宝公钥证书 路径 - 'alipay_public_cert_path' => base_path().'/payment/alipayCertPublicKey_RSA2.crt', + 'alipay_public_cert_path' => base_path() . '/payment/alipayCertPublicKey_RSA2.crt', // 必填-支付宝根证书 路径 - 'alipay_root_cert_path' => base_path().'/payment/alipayRootCert.crt', + 'alipay_root_cert_path' => base_path() . '/payment/alipayRootCert.crt', // 选填-同步回调地址 'return_url' => 'https://webman.tinywan.cn/payment/alipay-return', // 选填-异步回调地址 @@ -31,16 +32,18 @@ return [ 'default' => [ // 必填-商户号,服务商模式下为服务商商户号 'mch_id' => '1654274867', + // 选填-v2商户私钥 + 'mch_secret_key_v2' => 'FC685E79840793CE86AE621CE9EDFCDA', // 必填-商户秘钥 'mch_secret_key' => '7E00D167C9793006C93F4FB4CF65BCC2', // 必填-商户私钥 字符串或路径 - 'mch_secret_cert' => runtime_path().'/cert/c208f16ad08e6d2516e0b73e6d0ab8da.pem', + 'mch_secret_cert' => runtime_path() . '/cert/c208f16ad08e6d2516e0b73e6d0ab8da.pem', // 必填-商户公钥证书路径 - 'mch_public_cert_path' =>runtime_path().'/cert/82fdc3426e3aeb9e5df91a9547ac5ef3.pem', + 'mch_public_cert_path' => runtime_path() . '/cert/82fdc3426e3aeb9e5df91a9547ac5ef3.pem', // 必填 'notify_url' => 'https://erp.lihaink.cn/api/pay/notifyMnp', // 选填-公众号 的 app_id - 'mp_app_id' => '', + 'mp_app_id' => 'wxe2428e8fe6767e45', // 选填-小程序 的 app_id 'mini_app_id' => 'wxdee751952c8c2027', // 选填-app 的 app_id @@ -58,15 +61,14 @@ return [ // 选填-服务商模式下,子商户id 'sub_mch_id' => '', // 选填-微信公钥证书路径, optional,强烈建议 php-fpm 模式下配置此参数 - 'wechat_public_cert_path' => [ - ], + 'wechat_public_cert_path' => [], // 选填-默认为正常模式。可选为: MODE_NORMAL, MODE_SERVICE 'mode' => \Yansongda\Pay\Pay::MODE_NORMAL, ] ], 'logger' => [ 'enable' => false, - 'file' => runtime_path().'/logs/alipay.log', + 'file' => runtime_path() . '/logs/alipay.log', 'level' => 'debug', // 建议生产环境等级调整为 info,开发环境为 debug 'type' => 'single', // optional, 可选 daily. 'max_file' => 30, // optional, 当 type 为 daily 时有效,默认 30 天 @@ -77,4 +79,4 @@ return [ // 更多配置项请参考 [Guzzle](https://guzzle-cn.readthedocs.io/zh_CN/latest/request-options.html) ], '_force' => true, -]; \ No newline at end of file +];