This commit is contained in:
mkm 2024-05-07 16:41:51 +08:00
parent 1113b18e4f
commit 461809eb79
5 changed files with 41 additions and 21 deletions

View File

@ -42,13 +42,21 @@ class GoodsclassLists extends BaseAdminDataLists implements ListsSearchInterface
*/ */
public function lists(): array public function lists(): array
{ {
$lists= Goodsclass::where($this->searchWhere) $lists = Goodsclass::where($this->searchWhere)
->where('pid', 0)
->field(['id', 'pid', 'name', 'data', 'pic', 'sort']) ->field(['id', 'pid', 'name', 'data', 'pic', 'sort'])
->limit($this->limitOffset, $this->limitLength) ->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc']) ->order(['id' => 'desc'])
->select() ->select()->each(function ($item) {
->toArray(); $a = Goodsclass::where('pid', $item['id'])->field(['id', 'pid', 'name', 'data', 'pic', 'sort'])->select();
return linear_to_tree($lists, 'children'); $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 public function count(): int
{ {
return Goodsclass::where($this->searchWhere)->count(); return Goodsclass::where($this->searchWhere)->where('pid', 0)
->count();
} }
} }

View File

@ -42,13 +42,21 @@ class GoodsclassLists extends BaseAdminDataLists implements ListsSearchInterface
*/ */
public function lists(): array public function lists(): array
{ {
$lists= Goodsclass::where($this->searchWhere) $lists = Goodsclass::where($this->searchWhere)
->where('pid', 0)
->field(['id', 'pid', 'name', 'data', 'pic', 'sort']) ->field(['id', 'pid', 'name', 'data', 'pic', 'sort'])
->limit($this->limitOffset, $this->limitLength) ->limit($this->limitOffset, $this->limitLength)
->order(['id' => 'desc']) ->order(['id' => 'desc'])
->select() ->select()->each(function ($item) {
->toArray(); $a = Goodsclass::where('pid', $item['id'])->field(['id', 'pid', 'name', 'data', 'pic', 'sort'])->select();
return linear_to_tree($lists, 'children'); $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 public function count(): int
{ {
return Goodsclass::where($this->searchWhere)->count(); return Goodsclass::where($this->searchWhere)->where('pid', 0)
->count();
} }
} }

2
composer.lock generated
View File

@ -7366,5 +7366,5 @@
"ext-json": "*" "ext-json": "*"
}, },
"platform-dev": [], "platform-dev": [],
"plugin-api-version": "2.3.0" "plugin-api-version": "2.6.0"
} }

Binary file not shown.

View File

@ -1,4 +1,5 @@
<?php <?php
/** /**
* @desc 支付配置文件 * @desc 支付配置文件
* @author Tinywan(ShaoBo Wan) * @author Tinywan(ShaoBo Wan)
@ -12,11 +13,11 @@ return [
// 必填-应用私钥 字符串或路径 // 必填-应用私钥 字符串或路径
'app_secret_cert' => 'MIIEpAIBAAKCxxxxxxxxxxxxxxP4r3m4OUmD/+XDgCg==', 'app_secret_cert' => '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', 'return_url' => 'https://webman.tinywan.cn/payment/alipay-return',
// 选填-异步回调地址 // 选填-异步回调地址
@ -31,16 +32,18 @@ return [
'default' => [ 'default' => [
// 必填-商户号,服务商模式下为服务商商户号 // 必填-商户号,服务商模式下为服务商商户号
'mch_id' => '1654274867', 'mch_id' => '1654274867',
// 选填-v2商户私钥
'mch_secret_key_v2' => 'FC685E79840793CE86AE621CE9EDFCDA',
// 必填-商户秘钥 // 必填-商户秘钥
'mch_secret_key' => '7E00D167C9793006C93F4FB4CF65BCC2', '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', 'notify_url' => 'https://erp.lihaink.cn/api/pay/notifyMnp',
// 选填-公众号 的 app_id // 选填-公众号 的 app_id
'mp_app_id' => '', 'mp_app_id' => 'wxe2428e8fe6767e45',
// 选填-小程序 的 app_id // 选填-小程序 的 app_id
'mini_app_id' => 'wxdee751952c8c2027', 'mini_app_id' => 'wxdee751952c8c2027',
// 选填-app 的 app_id // 选填-app 的 app_id
@ -58,15 +61,14 @@ return [
// 选填-服务商模式下子商户id // 选填-服务商模式下子商户id
'sub_mch_id' => '', 'sub_mch_id' => '',
// 选填-微信公钥证书路径, optional强烈建议 php-fpm 模式下配置此参数 // 选填-微信公钥证书路径, optional强烈建议 php-fpm 模式下配置此参数
'wechat_public_cert_path' => [ 'wechat_public_cert_path' => [],
],
// 选填-默认为正常模式。可选为: MODE_NORMAL, MODE_SERVICE // 选填-默认为正常模式。可选为: MODE_NORMAL, MODE_SERVICE
'mode' => \Yansongda\Pay\Pay::MODE_NORMAL, 'mode' => \Yansongda\Pay\Pay::MODE_NORMAL,
] ]
], ],
'logger' => [ 'logger' => [
'enable' => false, 'enable' => false,
'file' => runtime_path().'/logs/alipay.log', 'file' => runtime_path() . '/logs/alipay.log',
'level' => 'debug', // 建议生产环境等级调整为 info开发环境为 debug 'level' => 'debug', // 建议生产环境等级调整为 info开发环境为 debug
'type' => 'single', // optional, 可选 daily. 'type' => 'single', // optional, 可选 daily.
'max_file' => 30, // optional, 当 type 为 daily 时有效,默认 30 天 'max_file' => 30, // optional, 当 type 为 daily 时有效,默认 30 天