| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246 |
- <?php
- /*
- * @Author: chaimeihan 1852293413@qq.com
- * @Date: 2024-04-23 14:59:58
- * @LastEditors: chaimeihan 1852293413@qq.com
- * @LastEditTime: 2024-05-09 08:58:41
- * @FilePath: \PHP\models\RcCommissionLog.php
- * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
- */
- namespace app\models;
- use Yii;
- use yii\behaviors\TimestampBehavior;
- use app\modules\admin\models\wechat_mp\CardForm;
- use app\utils\IotCloudHelper;
- /**
- * This is the model class for table "{{%rc_commission_log}}".
- *
- * @property integer $id
- * @property integer $store_id
- * @property integer $order_type
- * @property integer $order_id
- * @property integer $user_id
- * @property integer $amount
- * @property string $desc
- * @property integer $before
- * @property integer $after
- * @property string $operator
- * @property integer $operator_id
- * @property integer $log_type
- * @property integer $type
- * @property integer $operator_type
- * @property string $pic_url
- * @property string $explain
- * @property integer $created_at
- * @property integer $from
- * @property integer $from_user_id
- * @property integer $profit
- * @property integer $saas_id
- */
- class RcCommissionLog extends \yii\db\ActiveRecord
- {
- /**
- * 收入类型
- */
- const LOG_TYPE_INCOME = 1;
- /**
- * 支出类型
- */
- const LOG_TYPE_EXPEND = 2;
- public static $type_budget = [
- self::LOG_TYPE_INCOME,
- self::LOG_TYPE_EXPEND
- ];
- /**
- * 充值订单
- */
- const TYPE_RECHARGE_ORDER = 0;
- /**
- * 商城订单
- */
- const TYPE_PLATFORM_ORDER = 1;
- /**
- * 秒杀订单
- */
- const TYPE_MS_ORDER = 2;
- /**
- * 拼团订单
- */
- const TYPE_PT_ORDER = 3;
- /**
- * 商城订单退款
- */
- const TYPE_PLATFORM_REFUND_ORDER = 4;
- /**
- * 充值订单退款(减余额)
- */
- const TYPE_RECHARGE_REFUND_ORDER = 41;
- /**
- * 商城秒杀退款
- */
- const TYPE_MS_REFUND_ORDER = 5;
- /**
- * 商城拼团退款
- */
- const TYPE_PT_REFUND_ORDER = 6;
- /**
- * 商城预约退款
- */
- const TYPE_YY_REFUND_ORDER = 7;
- /**
- * 预约订单
- */
- const TYPE_YY_ORDER = 8;
- /**
- * 预约订单
- */
- const TYPE_SCRATCH_ORDER = 9;
- /**
- * 大转盘
- */
- const TYPE_POND_ORDER = 10;
- /**
- * 供货商订单
- */
- const TYPE_SUPPLIER_ORDER = 11;
- /**
- * 会员购买订单
- */
- const TYPE_LEVEL_ORDER = 12;
- /**
- * 当面付
- */
- const TYPE_SCAN_CODE_PAY = 13;
- /**
- * saas积分商品订单
- */
- const TYPE_SAAS_INTEGRAL_ORDER = 14;
- /**
- * saas积分商品订单
- */
- const TYPE_BALANCE_TO_COMMISSION = 15;
- /**
- * 签到送积分
- */
- const TYPE_REGISTER_INTEGRAL = 16;
- /**
- * 问答专区提问
- */
- const TYPE_QUESTION_INTEGRAL = 17;
- /**
- * 问答专区看视频广告
- */
- const TYPE_QUESTION_AD = 18;
- /**
- * 充值一级上级返现奖励
- */
- const TYPE_LEVEL_ONE_BONUS = 20;
- /**
- * 充值推广佣金
- */
- const TYPE_REFERRAL_COMMISSION = 21;
- /**
- * 充值一级上级返现奖励
- */
- const TYPE_LEVEL_TWO_BONUS = 22;
- /**
- * 余额
- */
- const TYPE_BALANCE = 2;
- /**
- * 积分
- */
- const TYPE_INTEGRAL = 1;
- /**
- * 商品余额抵扣
- */
- const TYPE_GOODS_BALANCE = 19;
- /**
- * 微信
- */
- const TYPE_WECHAT = 3;
- /**
- * 支付宝
- */
- const TYPE_ALIPAY = 4;
- public static $valid_type = [
- self::TYPE_BALANCE,
- self::TYPE_INTEGRAL,
- self::TYPE_WECHAT,
- self::TYPE_ALIPAY
- ];
- /**
- * 后台改动
- */
- const TYPE_OPERATOR_BACK = 2;
- /**
- * 前台变化
- */
- const TYPE_OPERATOR_NORMAL = 1;
- public static $type_order = [
- self::TYPE_RECHARGE_ORDER,
- self::TYPE_PLATFORM_ORDER,
- self::TYPE_MS_ORDER,
- self::TYPE_PT_ORDER,
- self::TYPE_PLATFORM_REFUND_ORDER,
- self::TYPE_MS_REFUND_ORDER,
- self::TYPE_PT_REFUND_ORDER
- ];
- /**
- * @inheritdoc
- */
- public static function tableName()
- {
- return '{{%rc_commission_log}}';
- }
- /**
- * @inheritdoc
- */
- public function rules()
- {
- return [
- [[
- 'user_id', 'type', 'amount', 'desc', 'order_type',
- 'log_type', 'type', 'parent_id', 'recharge_id', 'commission_type'
- ], 'required'],
- [[
- 'user_id', 'type', 'created_at', 'order_type', 'order_id', 'log_type',
- ], 'integer'],
- [['amount',], 'number'],
- [['desc',], 'string'],
- ];
- }
- /**
- * @inheritdoc
- */
- public function attributeLabels()
- {
- return [];
- }
- }
|