| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- <?php
- /**
- * 重庆赤晓店信息科技有限公司
- * https://www.chixiaodian.com
- * Copyright (c) 2023 赤店商城 All rights reserved.
- */
- namespace app\plugins\food\models;
- use yii\behaviors\TimestampBehavior;
- use yii\db\ActiveRecord;
- /**
- * 点餐分类
- * Class FoodCat
- * @package app\plugins\food\models
- * @property integer $id
- * @property integer $store_id
- * @property string $name
- * @property string $desc
- * @property string $pic_url
- * @property integer $sort
- * @property integer $is_delete
- * @property string $is_show
- * @property string $created_at
- * @property string $updated_at
- */
- class FoodCat extends ActiveRecord
- {
- public function behaviors()
- {
- return [
- [
- // 自动更新创建和更新时间
- 'class' => TimestampBehavior::class,
- 'value' => time()
- ]
- ];
- }
- public static function tableName()
- {
- return '{{%food_cat}}';
- }
- public function rules()
- {
- return [
- [['store_id', 'name',], 'required'],
- [['store_id', 'sort', 'created_at', 'updated_at', 'is_delete', 'is_show'], 'integer'],
- [['pic_url'], 'string'],
- [['name', 'desc'], 'string', 'max' => 255],
- ];
- }
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'store_id' => '商城id',
- 'name' => '分类名称',
- 'desc' => '描述',
- 'pic_url' => '分类图片url',
- 'sort' => '排序,升序',
- 'created_at' => '创建时间',
- 'updated_at' => '更新时间',
- 'is_delete' => 'Is Delete',
- 'is_show' => '是否显示',
- ];
- }
- }
|