| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 |
- <?php
- /**
- * 重庆赤晓店信息科技有限公司
- * https://www.chixiaodian.com
- * Copyright (c) 2023 赤店商城 All rights reserved.
- */
- namespace app\models;
- use yii\db\ActiveRecord;
- use yii\behaviors\TimestampBehavior;
- use Yii;
- /**
- * This is the model class for table "{{%sharing_receiver_custom}}".
- *
- * @property integer $id
- * @property string $name
- * @property integer $sharing_type
- * @property string $type_id
- * @property integer $extra_saas_user_id
- * @property integer $sharing_way
- * @property integer $sharing_store_id
- * @property float $sharing_profit
- * @property float $amount
- * @property integer $is_delete
- * @property integer $created_at
- * @property integer $updated_at
- */
- class SharingReceiverCustom extends \yii\db\ActiveRecord
- {
- /**
- * {@inheritdoc}
- */
- public static function tableName()
- {
- return '{{%sharing_receiver_custom}}';
- }
- const IS_DELETE_YES = 1;// 已删除
- const IS_DELETE_NO = 0;// 未删除
- /**
- * 分账类型:微信用户
- */
- const SHARING_TYPE_USER = 0;
- /**
- * 分账类型:商户号
- */
- const SHARING_TYPE_MERCHANT = 1;
- const SHARING_TYPE = [
- self::SHARING_TYPE_USER ,
- self::SHARING_TYPE_MERCHANT,
- ];
- /**
- * 分账方式:基于店铺
- */
- const SHARING_WAY_STORE = 0;
- /**
- * 分账方式:基于平台
- */
- const SHARING_WAY_PLATFORM = 1;
- const SHARING_WAY = [
- self::SHARING_WAY_STORE ,
- self::SHARING_WAY_PLATFORM,
- ];
- 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 [
- [['sharing_profit', 'amount'], 'number'],
- [['name', 'type_id'], 'string'],
- [['id', 'sharing_type', 'sharing_way', 'sharing_store_id', 'is_delete', 'created_at', 'updated_at', 'extra_saas_user_id'], 'integer'],
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function attributeLabels()
- {
- return [
- 'id' => '',
- 'name' => '分账名称',
- 'sharing_type' => '分账类型:0=微信用户;1=商户号',
- 'type_id' => '分类类型ID:联盟用户ID或者商户号',
- 'extra_saas_user_id' => '额外用户ID(如果sharing_type = 1时候需要)',
- 'sharing_way' => '分账方式:0=基于店铺;1=基于平台',
- 'sharing_store_id' => '分账方式如果是基于店铺,店铺ID',
- 'sharing_profit' => '分账比例',
- 'amount' => '累计佣金',
- 'is_delete' => '',
- 'created_at' => '',
- 'updated_at' => '',
- ];
- }
- }
|