1
This commit is contained in:
parent
a3880e9767
commit
25d61b787a
@ -57,6 +57,7 @@ class CommonGoodsEditForm extends Model
|
|||||||
public $newAttrs;
|
public $newAttrs;
|
||||||
|
|
||||||
|
|
||||||
|
public $banner_urls;
|
||||||
public $cat_id;
|
public $cat_id;
|
||||||
public $cat1_id;
|
public $cat1_id;
|
||||||
public $cat2_id;
|
public $cat2_id;
|
||||||
@ -68,7 +69,7 @@ class CommonGoodsEditForm extends Model
|
|||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
[['name', 'subtitle', 'detail', 'cover_pic', 'video_url', 'unit', 'plugin_sign', 'goods_no',], 'trim'],
|
[['name', 'subtitle', 'detail', 'cover_pic', 'video_url', 'unit', 'plugin_sign', 'goods_no',], 'trim'],
|
||||||
[['name', 'subtitle', 'detail', 'cover_pic', 'video_url', 'unit', 'plugin_sign', 'goods_no', 'date'], 'string'],
|
[['name', 'subtitle', 'detail', 'cover_pic', 'video_url', 'banner_urls', 'unit', 'plugin_sign', 'goods_no', 'date'], 'string'],
|
||||||
[['original_price', 'cost_price', 'price', 'goods_weight'], 'number'],
|
[['original_price', 'cost_price', 'price', 'goods_weight'], 'number'],
|
||||||
[['type', 'use_attr', 'goods_stock', 'virtual_sales', 'confine_count', 'freight_id', 'sort', 'cx_mch_id'], 'integer'],
|
[['type', 'use_attr', 'goods_stock', 'virtual_sales', 'confine_count', 'freight_id', 'sort', 'cx_mch_id'], 'integer'],
|
||||||
|
|
||||||
@ -80,7 +81,7 @@ class CommonGoodsEditForm extends Model
|
|||||||
[['cost_price', 'original_price', 'price'], 'number', 'max' => 9999999],
|
[['cost_price', 'original_price', 'price'], 'number', 'max' => 9999999],
|
||||||
[['sort', 'virtual_sales', 'freight_id'], 'default', 'value' => 100],
|
[['sort', 'virtual_sales', 'freight_id'], 'default', 'value' => 100],
|
||||||
[['confine_count', 'use_attr'], 'default', 'value' => 0],
|
[['confine_count', 'use_attr'], 'default', 'value' => 0],
|
||||||
[['name', 'price', 'cover_pic', 'type', 'plugin_sign', 'model', 'cx_mch_id'], 'required'],
|
[['name', 'price', 'cover_pic', 'type', 'plugin_sign', 'banner_urls', 'model', 'cx_mch_id'], 'required'],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -177,6 +178,8 @@ class CommonGoodsEditForm extends Model
|
|||||||
$goods_hub->detail = $this->detail;
|
$goods_hub->detail = $this->detail;
|
||||||
$goods_hub->cover_pic = $this->cover_pic;
|
$goods_hub->cover_pic = $this->cover_pic;
|
||||||
|
|
||||||
|
$goods_hub->banner_urls = $this->banner_urls;
|
||||||
|
|
||||||
$pic_urls = is_string($this->pic_urls) ? $this->pic_urls : json_encode($this->pic_urls);
|
$pic_urls = is_string($this->pic_urls) ? $this->pic_urls : json_encode($this->pic_urls);
|
||||||
$goods_hub->pic_urls = $pic_urls;
|
$goods_hub->pic_urls = $pic_urls;
|
||||||
$video_urls = is_string($this->video_url) ? $this->video_url : json_encode($this->video_url);
|
$video_urls = is_string($this->video_url) ? $this->video_url : json_encode($this->video_url);
|
||||||
|
|||||||
@ -151,13 +151,29 @@ $this->params['breadcrumbs'][] = $this->title;
|
|||||||
'accept' => 'images',
|
'accept' => 'images',
|
||||||
'id' => 'pic_urls',
|
'id' => 'pic_urls',
|
||||||
'name' => 'pic_urls',
|
'name' => 'pic_urls',
|
||||||
'label' => '冠军详情图(多张)',
|
'label' => '冠军轮播图(多张)',
|
||||||
'value' => $model->goodsHub ? $model->goodsHub->pic_urls : '',
|
'value' => $model->goodsHub ? $model->goodsHub->pic_urls : '',
|
||||||
'tip' => '图片大小750×750',
|
'tip' => '图片大小750×750',
|
||||||
'required' => true,
|
'required' => true,
|
||||||
// 'imageCompressEnable' => 1,
|
// 'imageCompressEnable' => 1,
|
||||||
// 'imageCompressBorder' => 750,
|
// 'imageCompressBorder' => 750,
|
||||||
]) ?>
|
]) ?>
|
||||||
|
|
||||||
|
|
||||||
|
<?= PickFile::widget([
|
||||||
|
'accept' => 'images',
|
||||||
|
'id' => 'banner_urls',
|
||||||
|
'name' => 'banner_urls',
|
||||||
|
'label' => '冠军详情图',
|
||||||
|
'value' => $model->goodsHub ? $model->goodsHub->banner_urls : '',
|
||||||
|
// 'tip' => '图片大小750×750',
|
||||||
|
'required' => true,
|
||||||
|
'imageCompressEnable' => 1,
|
||||||
|
'imageCompressBorder' => 750,
|
||||||
|
]) ?>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -71,7 +71,7 @@ class GoodsController extends Controller
|
|||||||
$form->cx_mch_id = $this->cx_mch_id;
|
$form->cx_mch_id = $this->cx_mch_id;
|
||||||
$form->status = Goods::STATUS_ONLINE;
|
$form->status = Goods::STATUS_ONLINE;
|
||||||
$form->plugin_sign = SysConst::$cxPluginSceneIntegralMall;
|
$form->plugin_sign = SysConst::$cxPluginSceneIntegralMall;
|
||||||
$form->setFields('g.id,g.price,g.date,g.sort,gh.subtitle,g.created_at,gh.name,gh.cover_pic,gh.video_url,gh.pic_urls');
|
$form->setFields('g.id,g.price,g.date,g.sort,gh.subtitle,gh.banner_urls,g.created_at,gh.name,gh.cover_pic,gh.video_url,gh.pic_urls');
|
||||||
$data = $form->search();
|
$data = $form->search();
|
||||||
|
|
||||||
foreach ($data['data'] as $key => $value) {
|
foreach ($data['data'] as $key => $value) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user