mirror of
https://gitee.com/zoujingli/ThinkAdmin.git
synced 2025-05-22 06:49:15 +08:00
优化代码
This commit is contained in:
parent
2ac2f95e1f
commit
d79b93b9e1
@ -8,7 +8,6 @@ use app\data\service\NewsService;
|
||||
use think\admin\Controller;
|
||||
use think\admin\extend\CodeExtend;
|
||||
use think\admin\helper\QueryHelper;
|
||||
use think\admin\model\SystemBase;
|
||||
|
||||
/**
|
||||
* 文章内容管理
|
||||
|
@ -136,7 +136,7 @@ class OrderService extends Service
|
||||
$items = $query->withoutField('id,uuid,status,deleted,create_at')->whereIn('order_no', $nobs)->select()->toArray();
|
||||
// 关联用户数据
|
||||
$fields = 'phone,username,nickname,headimg,status,vip_code,vip_name';
|
||||
if ($data) UserAdminService::instance()->buildByUid($data, 'uuid', 'user', $fields);
|
||||
UserAdminService::instance()->buildByUid($data, 'uuid', 'user', $fields);
|
||||
if ($from) UserAdminService::instance()->buildByUid($data, 'puid1', 'from', $fields);
|
||||
foreach ($data as &$vo) {
|
||||
[$vo['sales'], $vo['truck'], $vo['items']] = [0, $trucks[$vo['order_no']] ?? [], []];
|
||||
|
@ -232,7 +232,7 @@ abstract class PaymentService
|
||||
*/
|
||||
public static function name(string $type): string
|
||||
{
|
||||
return self::TYPES[$type]['name'] ?? $type;
|
||||
return static::TYPES[$type]['name'] ?? $type;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -243,7 +243,7 @@ abstract class PaymentService
|
||||
public static function getTypeAll(array $types = []): array
|
||||
{
|
||||
$binds = array_keys(UserAdminService::TYPES);
|
||||
foreach (self::TYPES as $k => $v) if (isset($v['bind'])) {
|
||||
foreach (static::TYPES as $k => $v) if (isset($v['bind'])) {
|
||||
if (array_intersect($v['bind'], $binds)) $types[$k] = $v;
|
||||
}
|
||||
return $types;
|
||||
|
Loading…
x
Reference in New Issue
Block a user