Browse Source

Merge branch 'antshop' into kernel

wechat_public_accounts
root 5 years ago
parent
commit
e0e174bdb4
  1. 12
      backend/modules/file/logic/file/FileManager.php
  2. 2
      backend/modules/goods/models/searchs/GoodsSearch.php
  3. 2
      backend/modules/goods/views/goods/view.php

12
backend/modules/file/logic/file/FileManager.php

@ -61,13 +61,11 @@ class FileManager
foreach ($temFileIdArr as $key => $value) { foreach ($temFileIdArr as $key => $value) {
$temFile = TemFile::findOne($value); $temFile = TemFile::findOne($value);
if (!$temFile) {
throw new \Exception('存在查找不到的文件');
}
$res = self::saveNewFile($temFile, $ownId, $ownType);
if ($key == 0) {
$firstFileId = $res['file_id'];
if ($temFile) {
$res = self::saveNewFile($temFile, $ownId, $ownType);
if ($key == 0) {
$firstFileId = $res['file_id'];
}
} }
} }

2
backend/modules/goods/models/searchs/GoodsSearch.php

@ -63,7 +63,7 @@ class GoodsSearch extends Goods
'width'=>'10%', 'width'=>'10%',
'format' => 'raw', 'format' => 'raw',
'value' => function ($model) { 'value' => function ($model) {
return $model->image ?
return $model->imageFile ?
Html::img(['/'.$model->imageFile->path], ['style' => 'width:80px']) Html::img(['/'.$model->imageFile->path], ['style' => 'width:80px'])
: '<div class="table_not_setting">未设置</div>'; : '<div class="table_not_setting">未设置</div>';

2
backend/modules/goods/views/goods/view.php

@ -77,7 +77,7 @@ $this->params['breadcrumbs'][] = $this->title;
['attribute' => 'image', ['attribute' => 'image',
'format' => 'raw', 'format' => 'raw',
'value' => function ($model) { 'value' => function ($model) {
return $model->image ?
return $model->imageFile ?
Html::img(['/'.$model->imageFile->path], ['style' => 'width:80px']) Html::img(['/'.$model->imageFile->path], ['style' => 'width:80px'])
: '<div class="table_not_setting">未设置</div>'; : '<div class="table_not_setting">未设置</div>';

Loading…
Cancel
Save