| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- <?php
- /**
- * 厦门云联储网络科技有限公司
- * https://www.baokuaiyun.com
- * Copyright (c) 2023 爆块云 All rights reserved.
- */
- namespace app\models;
- /**
- * Class StoreShareMoney
- * @package app\models
- * @property integer $id
- * @property float $profit
- * @property float $total_price
- * @property integer $store_id
- * @property integer $created_at
- * @property float $commission
- * @property integer $is_delete
- * @property string $desc
- * @property integer $order_id
- * @property integer $user_id
- * @property integer $type
- * @property integer $status
- * @property integer $order_type
- * @property integer $cloud_type
- * @property integer $is_send
- **/
- class StoreShareMoney extends \yii\db\ActiveRecord
- {
- const TYPE_AGENT = 0;
- const TYPE_AREA_AGENT = 1;
- const TYPE_GOODS_AGENT = 2;
- const TYPE_BD_AGENT = 3;
- const STATUS_STORE_SETTLED = 0;//0店铺入驻费用返利
- const STATUS_STORE_ORDER = 1;//1店铺下单返利
- const STATUS_STORE_PAYOUTS = 2;// 2支出
- /**
- * @var false|int|mixed|null
- */
- private $end_time;
- /**
- * @inheritdoc
- */
- public static function tableName()
- {
- return '{{%store_share_money}}';
- }
- /**
- * @inheritdoc
- */
- public function rules()
- {
- return [
- [['id', 'store_id', 'created_at', 'user_id', 'is_delete','type','order_id', 'status', 'order_type',
- 'cloud_type', 'is_send'], 'integer'],
- [['desc'], 'string'],
- [['total_price','commission','profit'], 'double'],
- ];
- }
- /**
- * @inheritdoc
- */
- public function attributeLabels()
- {
- return [
- 'id' =>"ID",
- 'store_id' =>"商场ID",
- 'profit' =>"分佣比例",
- 'total_price' =>"支付总金额",
- 'user_id' =>"用户ID",
- 'desc' =>"支付项目名称",
- 'created_at' =>"创建时间",
- 'order_id' =>"订单ID",
- 'type' =>"类型",
- 'is_delete' =>"是否删除",
- 'commission' =>"佣金",
- 'status' =>"代理类型0代理 1区域代理",
- 'order_type' =>"订单类型",
- 'cloud_type' =>'身份类型',
- 'is_send' =>'是否发放'
- ];
- }
- public function getStore(){
- return $this->hasOne(Store::className(),['id'=>'store_id']);
- }
- public function getReorder(){
- return $this->hasOne(StoreReOrder::className(),['id'=>'order_id']);
- }
- public function getOrder(){
- if ((int)$this->cloud_type === 0) {
- return $this->hasOne(Order::className(),['id'=>'order_id']);
- } else {
- return $this->hasOne(PurchaseOrder::className(),['id'=>'order_id']);
- }
- }
- }
|