| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- <?php
- /**
- * 厦门云联储网络科技有限公司
- * https://www.baokuaiyun.com
- * Copyright (c) 2023 爆块云 All rights reserved.
- */
- namespace app\models;
- use Yii;
- use app\models\common\Upload;
- /**
- * This is the model class for table "{{%goods_pic}}".
- *
- * @property integer $id
- * @property integer $goods_id
- * @property string $pic_url
- * @property integer $is_delete
- */
- class GoodsPic extends \yii\db\ActiveRecord
- {
- /**
- * @inheritdoc
- */
- public static function tableName()
- {
- return '{{%goods_pic}}';
- }
- /**
- * @inheritdoc
- */
- public function rules()
- {
- return [
- [['goods_id', 'is_delete'], 'integer'],
- [['pic_url'], 'required'],
- [['pic_url'], 'string'],
- ];
- }
- /**
- * @inheritdoc
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'goods_id' => 'Goods ID',
- 'pic_url' => 'Pic Url',
- 'is_delete' => 'Is Delete',
- ];
- }
- public function afterFind()
- {
- parent::afterFind();
- try {
- $this->pic_url = Upload::getImgStyle($this->pic_url);
- } catch (\Throwable $e) {}
- }
- }
|