| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- <?php
- /**
- * 厦门云联储网络科技有限公司
- * https://www.baokuaiyun.com
- * Copyright (c) 2023 爆块云 All rights reserved.
- */
- namespace app\models;
- use Yii;
- use yii\db\ActiveRecord;
- use yii\behaviors\TimestampBehavior;
- /**
- * This is the model class for table "{{%clerk}}".
- *
- * @property int $id 主键
- * @property int $store_id 商城id
- * @property int $user_id 用户id
- * @property int $shop_id 自提点id
- * @property int|null $order_count 核销订单数
- * @property float|null $money_count 核销总额
- * @property int|null $card_count 核销卡券数
- * @property int|null $created_at 添加时间
- * @property int|null $updated_at 更新时间
- * @property int $is_delete 是否删除
- */
- class Clerk extends \yii\db\ActiveRecord
- {
- /**
- * {@inheritdoc}
- */
- public static function tableName()
- {
- return '{{%clerk}}';
- }
- const IS_DELETE_YES = 1;//已删除
- const IS_DELETE_NO = 0;//未删除
- public function behaviors()
- {
- return [
- [
- 'class' => TimestampBehavior::class,
- 'attributes' => [
- ActiveRecord::EVENT_BEFORE_INSERT => ['updated_at', 'created_at'],
- ActiveRecord::EVENT_BEFORE_UPDATE => 'updated_at'
- ]
- ]
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function rules()
- {
- return [
- [['user_id', 'shop_id'], 'required'],
- [['id', 'store_id', 'user_id', 'shop_id', 'order_count', 'card_count', 'created_at', 'updated_at', 'is_delete'], 'integer'],
- [['money_count'], 'number'],
- [['id'], 'unique'],
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function attributeLabels()
- {
- return [
- 'id' => '主键',
- 'store_id' => '商城id',
- 'user_id' => '用户id',
- 'shop_id' => '自提点id',
- 'order_count' => '核销订单数',
- 'money_count' => '核销总额',
- 'card_count' => '核销卡券数',
- 'created_at' => '添加时间',
- 'updated_at' => '更新时间',
- 'is_delete' => '是否删除',
- ];
- }
- }
|