quanwei
2025-12-09 ca425b889f3c1b5847ffc26a0229307f7f8ef43e
admin/app/supplier/controller/product/Product.php
@@ -52,6 +52,7 @@
        $data = json_decode($this->postData()['params'], true);
        $data['is_newcomer'] = $supplier['is_newcomer'];
        $data['is_repurchase'] = $supplier['is_repurchase'];
        $data['is_vip'] = $supplier['is_vip'];
        // 添加商品
        if($scene == 'copy'){
            unset($data['create_time']);
@@ -91,7 +92,7 @@
     */
    public function getBaseData($supplier)
    {
        return $this->renderSuccess('', array_merge(ProductService::getEditData(null, 'add', $this->getSupplierId()),['is_newcomer'=>$supplier['is_newcomer'],'is_repurchase'=>$supplier['is_repurchase']]));
        return $this->renderSuccess('', array_merge(ProductService::getEditData(null, 'add', $this->getSupplierId()),['is_newcomer'=>$supplier['is_newcomer'],'is_repurchase'=>$supplier['is_repurchase'],'is_vip'=>$supplier['is_vip']]));
    }
    /**
@@ -113,12 +114,13 @@
            $model = ProductModel::detail($product_id);
            $is_newcomer = $supplier['is_newcomer'];
            $is_repurchase = $supplier['is_repurchase'];
            $is_vip = $supplier['is_vip'];
            $supplierName='';
            if($model['belonging_shop_supplier_id']){
                $belonging_shop_supplier= SupplierModel::detail($model['belonging_shop_supplier_id']);
                $supplierName=$belonging_shop_supplier['name'];
            }
            return $this->renderSuccess('', array_merge(ProductService::getEditData($model, $scene, $this->getSupplierId()), compact('model','is_newcomer','is_repurchase','supplierName')));
            return $this->renderSuccess('', array_merge(ProductService::getEditData($model, $scene, $this->getSupplierId()), compact('model','is_newcomer','is_repurchase','is_vip','supplierName')));
        }
        if ($scene == 'copy') {
            return $this->add($scene);
@@ -128,6 +130,7 @@
        $data = json_decode($this->postData()['params'], true);
        $data['is_newcomer'] = $supplier['is_newcomer'];
        $data['is_repurchase'] = $supplier['is_repurchase'];
        $data['is_vip'] = $supplier['is_vip'];
        // 更新记录
        if ($model->edit($data,$this->getSupplierId())) {
            return $this->renderSuccess('更新成功');