1
This commit is contained in:
parent
9a21291172
commit
b769d2eceb
@ -176,9 +176,13 @@ class CommonGoodsEditForm extends Model
|
|||||||
$goods_hub->cost_price = $this->cost_price ? $this->cost_price : $this->price;
|
$goods_hub->cost_price = $this->cost_price ? $this->cost_price : $this->price;
|
||||||
$goods_hub->detail = $this->detail;
|
$goods_hub->detail = $this->detail;
|
||||||
$goods_hub->cover_pic = $this->cover_pic;
|
$goods_hub->cover_pic = $this->cover_pic;
|
||||||
|
|
||||||
$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;
|
||||||
$goods_hub->video_url = $this->video_url;
|
$video_urls = is_string($this->video_url) ? $this->video_url : json_encode($this->video_url);
|
||||||
|
|
||||||
|
|
||||||
|
$goods_hub->video_url = $video_urls;
|
||||||
$goods_hub->unit = $this->unit;
|
$goods_hub->unit = $this->unit;
|
||||||
$goods_hub->type = $this->type;
|
$goods_hub->type = $this->type;
|
||||||
if (!$goods_hub->save()) {
|
if (!$goods_hub->save()) {
|
||||||
|
|||||||
@ -196,7 +196,10 @@ class GoodsController extends Controller
|
|||||||
|
|
||||||
$model->date = date('Y-m-d', $model->date);
|
$model->date = date('Y-m-d', $model->date);
|
||||||
|
|
||||||
|
// var_dump($model->goodsHub->video_url);
|
||||||
|
// var_dump($model->goodsHub->pic_urls);
|
||||||
|
//
|
||||||
|
// die();
|
||||||
return $this->render('edit', [
|
return $this->render('edit', [
|
||||||
'cat_list' => $cat_list,
|
'cat_list' => $cat_list,
|
||||||
'cat_list1' => $cat_list1,
|
'cat_list1' => $cat_list1,
|
||||||
|
|||||||
@ -158,10 +158,39 @@ $this->params['breadcrumbs'][] = $this->title;
|
|||||||
// 'imageCompressEnable' => 1,
|
// 'imageCompressEnable' => 1,
|
||||||
// 'imageCompressBorder' => 750,
|
// 'imageCompressBorder' => 750,
|
||||||
]) ?>
|
]) ?>
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
if (!empty($model->goodsHub->video_url)) {
|
||||||
|
$json_de = json_decode($model->goodsHub->video_url, true);
|
||||||
|
$temp_arr = [];
|
||||||
|
foreach ($json_de as $key => $val) {
|
||||||
|
|
||||||
|
|
||||||
|
if($_SERVER['REMOTE_ADDR'] == '127.0.0.1'){
|
||||||
|
$val_model = filesize('D:/phpstudy_pro/WWW/cxgj/web' . $val);
|
||||||
|
}else{
|
||||||
|
$val_model = filesize(\app\components\SiteHelper::getFullUrl($val));
|
||||||
|
}
|
||||||
|
|
||||||
|
$explode = explode('/', $val);
|
||||||
|
$end = end($explode);
|
||||||
|
//
|
||||||
|
$temp_arr[] = [
|
||||||
|
'name' => $end,
|
||||||
|
'url' => $val,
|
||||||
|
'size_cn' => $val_model,
|
||||||
|
];
|
||||||
|
|
||||||
|
}
|
||||||
|
$model->goodsHub->video_url = json_encode($temp_arr, JSON_UNESCAPED_UNICODE);
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
|
|
||||||
<?= PickFile::widget([
|
<?= PickFile::widget([
|
||||||
'accept' => 'video',
|
'accept' => 'file',
|
||||||
|
'multiple' => true,
|
||||||
'id' => 'video_url',
|
'id' => 'video_url',
|
||||||
'name' => 'video_url',
|
'name' => 'video_url',
|
||||||
'label' => '冠军视频',
|
'label' => '冠军视频',
|
||||||
@ -212,6 +241,13 @@ $this->params['breadcrumbs'][] = $this->title;
|
|||||||
var returnUrl = "<?= $return_url ?>";
|
var returnUrl = "<?= $return_url ?>";
|
||||||
var data = obj.field;
|
var data = obj.field;
|
||||||
|
|
||||||
|
var urls = []
|
||||||
|
urls = window._filelist_video_url.map(function (val) {
|
||||||
|
console.log(val)
|
||||||
|
return val.url
|
||||||
|
})
|
||||||
|
|
||||||
|
data.video_url = JSON.stringify(urls);
|
||||||
|
|
||||||
// if (data.use_attr == 1) {
|
// if (data.use_attr == 1) {
|
||||||
// for (var i in data.attr) {
|
// for (var i in data.attr) {
|
||||||
|
|||||||
@ -97,6 +97,29 @@ $this->params['breadcrumbs'][] = $this->title;
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<?php
|
||||||
|
if (!empty($model->cover_pic)) {
|
||||||
|
$json_de = json_decode($model->cover_pic, true);
|
||||||
|
$temp_arr = [];
|
||||||
|
foreach ($json_de as $key => $val) {
|
||||||
|
if ($_SERVER['REMOTE_ADDR'] == '127.0.0.1') {
|
||||||
|
$val_model = filesize('D:/phpstudy_pro/WWW/cxgj/web' . $val);
|
||||||
|
} else {
|
||||||
|
$val_model = filesize(\app\components\SiteHelper::getFullUrl($val));
|
||||||
|
}
|
||||||
|
$explode = explode('/', $val);
|
||||||
|
$end = end($explode);
|
||||||
|
//
|
||||||
|
$temp_arr[] = [
|
||||||
|
'name' => $end,
|
||||||
|
'url' => $val,
|
||||||
|
'size_cn' => $val_model,
|
||||||
|
];
|
||||||
|
}
|
||||||
|
$model->cover_pic = json_encode($temp_arr, JSON_UNESCAPED_UNICODE);
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
<?= PickFile::widget([
|
<?= PickFile::widget([
|
||||||
'accept' => 'file',
|
'accept' => 'file',
|
||||||
'multiple' => true,
|
'multiple' => true,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user