| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- <?php
- namespace addons\Store\common\models;
- use common\enums\StatusEnum;
- use Yii;
- /**
- * This is the model class for table "{{%addons_store_addons}}".
- *
- * @property int $id 主键
- * @property string $title 中文名
- * @property string $name 插件名或标识
- * @property string|null $cover 封面
- * @property string|null $brief_introduction 简单介绍
- * @property int|null $status 状态[-1:删除;0:禁用;1启用;]
- * @property int|null $created_at 创建时间
- * @property int|null $updated_at 修改时间
- */
- class StoreAddons extends \common\models\base\BaseActiveRecord
- {
- /**
- * {@inheritdoc}
- */
- public static function tableName()
- {
- return '{{%addons_store_addons}}';
- }
- /**
- * {@inheritdoc}
- */
- public function rules()
- {
- return [
- [['status', 'created_at', 'updated_at'], 'integer'],
- [['title'], 'string', 'max' => 20],
- [['name'], 'string', 'max' => 100],
- [['cover'], 'string', 'max' => 200],
- [['brief_introduction'], 'string', 'max' => 140],
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function attributeLabels()
- {
- return [
- 'id' => '主键',
- 'title' => '中文名',
- 'name' => '插件名或标识',
- 'cover' => '封面',
- 'brief_introduction' => '简单介绍',
- 'status' => '状态[-1:删除;0:禁用;1启用;]',
- 'created_at' => '创建时间',
- 'updated_at' => '修改时间',
- ];
- }
- /**
- * 获取插件的默认跳转地址
- * @Author:lun
- * @Date:2023-12-19 17:14
- * @Copyright:copyright(c)2023 广东七件事集团
- * @param $addons
- * @return array|\yii\db\ActiveRecord[]
- */
- public static function getAddonsDefaultUrls($addons)
- {
- return StoreMenu::find()->select('addons_name,url')->where(['addons_name' => $addons, 'pid' => 0, 'status' => StatusEnum::ENABLED])->indexBy('addons_name')->asArray()->all();
- }
- }
|