| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- <?php
- /**
- * 厦门云联储网络科技有限公司
- * https://www.baokuaiyun.com
- * Copyright (c) 2023 爆块云 All rights reserved.
- */
- namespace app\models;
- use Yii;
- use yii\db\ActiveRecord;
- /**
- * This is the model class for table "{{%re_order}}".
- *
- * @property integer $id
- * @property integer $store_id
- * @property string $order_no
- * @property integer $user_id
- * @property string $pay_price
- * @property string $send_price
- * @property integer $pay_type
- * @property integer $is_pay
- * @property integer $pay_time
- * @property string $transaction_id
- * @property string $adapay_payment_id
- * @property integer $is_delete
- * @property integer $created_at
- * @property integer $is_platform
- * @property integer $type
- * @property integer $order_id
- * @property integer $is_use_platform_mch
- * @property integer $send_integral
- */
- class ReOrder extends ActiveRecord
- {
- public $is_combine_pay = 0;
- public $mobile = '';
- /**
- * 是否删除
- */
- CONST IS_DELETE = 1;
- CONST NOT_DELETE = 0;
- public static $valid_delete_arr = [
- self::IS_DELETE,
- self::NOT_DELETE
- ];
- /**
- * 是否支付
- */
- CONST IS_PAY = 1;
- CONST NOT_PAY = 0;
- public static $valid_pay_arr = [
- self::IS_PAY,
- self::NOT_PAY
- ];
- /**
- * @inheritdoc
- */
- public static function tableName()
- {
- return '{{%re_order}}';
- }
- /**
- * @inheritdoc
- */
- public function rules()
- {
- return [
- [['store_id', 'user_id', 'pay_type', 'is_pay', 'pay_time', 'is_delete', 'created_at', 'is_platform', 'type', 'order_id', 'is_use_platform_mch'], 'integer'],
- [['pay_price', 'send_price', 'send_integral'], 'number'],
- [['order_no', 'transaction_id'], 'string', 'max' => 255],
- [['adapay_payment_id'], 'safe'],
- ];
- }
- /**
- * @inheritdoc
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'store_id' => 'Store ID',
- 'order_no' => '订单号',
- 'user_id' => '用户',
- 'pay_price' => '支付金额',
- 'send_price' => '赠送金额',
- 'pay_type' => '支付方式 1--微信支付',
- 'is_pay' => '是否支付 0--未支付 1--支付',
- 'pay_time' => '支付时间',
- 'transaction_id' => '微信单号',
- 'is_delete' => 'Is Delete',
- 'created_at' => '添加时间',
- 'type' => '类型 0当面付',
- 'order_id' => '订单id',
- 'is_use_platform_mch' => '供应链系统下单时是否使用平台商户号,1使用,0未使用',
- ];
- }
- public function afterSave($insert, $changedAttributes)
- {
- parent::afterSave($insert, $changedAttributes);
- if (($insert && $this->is_pay == 1) || (isset($changedAttributes['is_pay']) && $this->is_pay == 1)) {
- \app\utils\Share\BonusPool::ShareHolderLevelJob($this->store_id, 0, $this->user_id);
- }
- }
- }
|