quanwei
2025-11-28 3ea53e61cc23fdb3ddf8b38a199ca60a6da8c407
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
 
namespace app\supplier\service;
 
use app\common\model\plus\agent\Setting as AgentSetting;
use app\common\model\settings\Setting;
use app\common\service\product\BaseProductService;
use app\shop\model\product\Category as CategoryModel;
use app\shop\model\settings\Delivery as DeliveryModel;
use app\shop\model\plus\table\Table as TableModel; //万能表单
use app\supplier\model\store\Store as StoreModel;
 
/**
 * 商品服务类
 */
class ProductService extends BaseProductService
{
    /**
     * 商品管理公共数据
     */
    public static function getEditData($model = null, $scene = 'edit', $shop_supplier_id)
    {
        // 商品分类
        $category = CategoryModel::getCacheAll();
        // 配送模板
        $delivery = DeliveryModel::getAll($shop_supplier_id);
        // 商品sku数据
        $specData = static::getSpecData($model);
        // 平台分销规则
        $agentSetting = AgentSetting::getItem('commission');
        $basicSetting = AgentSetting::getItem('basic');
        // 商品规格是否锁定
        $isSpecLocked = static::checkSpecLocked($model, $scene);
        // 商品是否开启平台审核
        $audit_setting = Setting::getItem('store');
        // 万能表单 by lyzflash
        $tableList = (new TableModel())->getAll();
        // 虚拟商品可核销门店
        $verifyStoreList = empty($model['verify_store_ids']) ? [] : (new StoreModel)->getListByIds($model['verify_store_ids'], $shop_supplier_id);
        return compact('category', 'delivery', 'specData', 'agentSetting', 'basicSetting', 'isSpecLocked', 'audit_setting', 'tableList', 'verifyStoreList');
    }
}