PHPackages                             daichongweb/dcat-sku-plus - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. daichongweb/dcat-sku-plus

ActiveLibrary

daichongweb/dcat-sku-plus
=========================

基于Dcat Admin的SKU扩展增强版

19PHP

Since Jun 10Pushed 3y ago1 watchersCompare

[ Source](https://github.com/daichongweb/dcat-sku-plus)[ Packagist](https://packagist.org/packages/daichongweb/dcat-sku-plus)[ RSS](/packages/daichongweb-dcat-sku-plus/feed)WikiDiscussions main Synced 4w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Dcat Admin SKU扩展增强版
===================

[](#dcat-admin-sku扩展增强版)

> 首先感谢前人的肩膀：
>
> 以及前人的前人的肩膀：
>
> 因改动太大，故没有往前面两位大佬的仓库中PR。

### **如果感觉好用，还请给个`Star`鼓励一下，谢谢 🍻 。**

[](#如果感觉好用还请给个star鼓励一下谢谢-beers-)

该插件是 [Dcat Admin](https://learnku.com/docs/dcat-admin/) 的插件，安装方式遵循Dcat Admin官方文档。

默认规格带有`图片`、`库存`、`价格`三个属性，可自行添加属性，自行处理。

改进的地方
-----

[](#改进的地方)

- 增加了独立设置相关属性的模块；
- 增加了多图上传功能；
- 增加删除图片时操作确认；
- 增加删除图片时同时删除后端图片；
- 增加图片上传、删除的URL配置项，不用再去修改js文件中的相关变量；

界面展示
----

[](#界面展示)

- 可以独立设置规格属性，默认`输入框`，支持`单选框`和`复选框`。

[![image](screenshots/attributes.png)](screenshots/attributes.png)

- 在表单界面规格名位置选择下拉框中的相关属性或者手动输入，生成SKU相关信息。

    [![image](screenshots/form.png)](screenshots/form.png)
- 插件配置页面可以配置图片上传、删除的URL。

    [![image](screenshots/setting.png)](screenshots/setting.png)

安装
--

[](#安装)

#### composer安装

[](#composer安装)

```
composer require abbotton/dcat-sku-plus
```

#### 应用商店安装

[](#应用商店安装)

```
等待Dcat Admin 上商店

```

使用
--

[](#使用)

```
// app/Admin/Controllers/ProductController.php

protected function form()
{
    return Form::make(new Product(), function (Form $form) {
        $skuParams = [
            // 扩展第一列
            [
                'name'    => '会员价', // table 第一行 title
                'field'   => 'member_price', // input 的 field_name 名称
                'default' => 5, // 默认值
            ],
            // 扩展第二列
        ];
        // 新增时
        $form->sku('sku', '生成SKU')->addColumn($skuParams);

        // 编辑时
        $skuData = []; // 数据结构见附录
        $skuString = json_encode($skuData);
        $form->sku('sku', '生成SKU')->addColumn($skuParams)->value($skuString);

        // 获取提交的数据.
        $form->saving(function (Form $form) {
            // 拿到SKU数据，按照业务逻辑做响应处理即可。
            dd($form->input('sku'));
        });
    });
}
```

附录
--

[](#附录)

#### 最终生成的SKU数据结构，仅供参考

[](#最终生成的sku数据结构仅供参考)

```
{
  "attrs": {
    "测试": [
      "测试1",
      "测试2"
    ],
    "颜色": [
      "绿",
      "黄"
    ],
    "含电池": [
      "含电池"
    ],
    "内存": [
      "8G"
    ]
  },
  "sku": [
    {
      "测试": "测试1",
      "颜色": "绿",
      "含电池": "含电池",
      "内存": "8G",
      "pic": [
        {
          "short_url": "sku/HjdrG0RpfIwI3kkgpNNFfmxPasgaOLg6bBPOCDxd.jpg",
          "full_url": "http://127.0.0.1:8000/storage/sku/HjdrG0RpfIwI3kkgpNNFfmxPasgaOLg6bBPOCDxd.jpg"
        },
        {
          "short_url": "sku/bkucABLjzRQ5pEHYX0gwdS1VxJrS6ObiQCIWVvIl.png",
          "full_url": "http://127.0.0.1:8000/storage/sku/bkucABLjzRQ5pEHYX0gwdS1VxJrS6ObiQCIWVvIl.png"
        }
      ],
      "stock": "",
      "price": "",
      "member_price": 5
    }
  ]
}
```

###  Health Score

16

—

LowBetter than 5% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity25

Early-stage or recently created project

 Bus Factor1

Top contributor holds 69.2% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/b10ad1cf921e1d6b46eb15353ea49f876fad511d5581b8d3eba194a4f863cd30?d=identicon)[DaiChongyu](/maintainers/DaiChongyu)

---

Top Contributors

[![daichongweb](https://avatars.githubusercontent.com/u/22912524?v=4)](https://github.com/daichongweb "daichongweb (9 commits)")[![Abbotton](https://avatars.githubusercontent.com/u/16308633?v=4)](https://github.com/Abbotton "Abbotton (4 commits)")

### Embed Badge

![Health badge](/badges/daichongweb-dcat-sku-plus/health.svg)

```
[![Health](https://phpackages.com/badges/daichongweb-dcat-sku-plus/health.svg)](https://phpackages.com/packages/daichongweb-dcat-sku-plus)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
