| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- <?php
- namespace common\models;
- use Yii;
- /**
- * This is the model class for table "{{%DEC_ORDER}}".
- *
- * @property string $ID
- * @property string $DEC_SN 报单编号
- * @property string $ORDER_SN 订单编号
- * @property string $USER_ID 会员ID
- * @property string $TO_USER_ID 报单对象ID
- * @property string $TYPE 报单类型
- * @property int $IS_ADMIN 是否管理员操作
- * @property string $DEC_AMOUNT 报单金额
- * @property string $DEC_PV 报单PV
- * @property string $PAID_WALLET 支付钱包
- * @property int $IS_BATCH 是否批量报单
- * @property string $REMARK 备注
- * @property string $REC_USER_ID 推荐人ID
- * @property string $CON_USER_ID 接点人ID
- * @property string $DEC_ID 报单中心ID
- * @property int $PERIOD_NUM 报单期数
- * @property string $P_CALC_MONTH 分区结算月
- * @property int $CALC_MONTH 结算月
- * @property int $CREATED_AT 创建时间
- * @property string $UPDATER 操作人
- * @property string $UPDATED_AT 更新时间
- * @property int $IS_DEL 是否删除
- * @property int $DELETED_AT 删除时间
- */
- class DecOrder extends \common\components\ActiveRecord
- {
- /**
- * {@inheritdoc}
- */
- public static function tableName()
- {
- return '{{%DEC_ORDER}}';
- }
- /**
- * {@inheritdoc}
- */
- public function rules()
- {
- return [
- [['USER_ID', 'TO_USER_ID','REC_USER_ID','CON_USER_ID',/*'DEC_ID',*/ 'TYPE', 'PAID_WALLET', 'PERIOD_NUM', 'P_CALC_MONTH', 'CREATED_AT'], 'required'],
- [['IS_ADMIN', 'IS_BATCH', 'PERIOD_NUM', 'CALC_MONTH', 'CREATED_AT', 'IS_DEL', 'DELETED_AT'], 'integer'],
- [['DEC_AMOUNT', 'DEC_PV'], 'number'],
- [['ID', 'DEC_SN', 'ORDER_SN', 'USER_ID', 'TO_USER_ID','REC_USER_ID','CON_USER_ID','DEC_ID', 'TYPE', 'UPDATER', 'UPDATED_AT'], 'string', 'max' => 32],
- [['PAID_WALLET'], 'string', 'max' => 48],
- [['REMARK'], 'string', 'max' => 4000],
- [['DEC_SN'], 'unique'],
- [['ID'], 'unique'],
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function attributeLabels()
- {
- return [
- 'ID' => 'ID',
- 'DEC_SN' => '报单编号',
- 'ORDER_SN' => '订单编号',
- 'USER_ID' => '会员ID',
- 'TO_USER_ID' => '报单对象ID',
- 'TYPE' => '报单类型',
- 'IS_ADMIN' => '是否管理员操作',
- 'DEC_AMOUNT' => '报单金额',
- 'DEC_PV' => '报单PV',
- 'PAID_WALLET' => '支付钱包',
- 'IS_BATCH' => '是否批量报单',
- 'REMARK' => '备注',
- 'REC_USER_ID' => '开拓人编号',
- 'CON_USER_ID' => '上级编号',
- 'DEC_ID' => '上级编号',
- 'PERIOD_NUM' => '报单期数',
- 'P_CALC_MONTH' => '分区结算月',
- 'CALC_MONTH' => '结算月',
- 'CREATED_AT' => '创建时间',
- 'UPDATER' => '操作人',
- 'UPDATED_AT' => '更新时间',
- 'IS_DEL' => '是否删除',
- 'DELETED_AT' => '删除时间',
- ];
- }
- public function getRecName()
- {
- return $this->hasOne(UserInfo::class, ['USER_ID' => 'TO_USER_ID']);
- }
- public function getUserByToUserId()
- {
- return $this->hasOne(User::class, ['ID' => 'TO_USER_ID']);
- }
- public function getUserByUserId()
- {
- return $this->hasOne(User::class, ['ID' => 'USER_ID']);
- }
- }
|