| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225 |
- <?php
- /**
- * 厦门云联储网络科技有限公司
- * https://www.baokuaiyun.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}}".
- *
- * @property int $id
- * @property int $store_id
- * @property string $order_no 订单号
- * @property string $transaction_id 微信交易号
- * @property int $type 接收方类型
- * @property int $user_id 接收方类型
- * @property int $saas_id 商盟用户id
- * @property string $account 分账接收方账户
- * @property string $name 分账接收方名称
- * @property string $description 分账原因描述
- * @property string $order_id
- * @property int $is_delete
- * @property int $amount
- * @property int $rate
- * @property int $from
- * @property string $err_code
- * @property string $err_code_des
- * @property int $is_pay
- * @property int $execute_type
- * @property string $remark
- * @property int $created_at
- * @property int $updated_at
- * @property int $is_platform
- * @property string $yunst_order_no
- */
- class SharingReceiver extends \yii\db\ActiveRecord
- {
- /**
- * {@inheritdoc}
- */
- public static function tableName()
- {
- return '{{%sharing_receiver}}';
- }
- const IS_DELETE_YES = 1;// 已删除
- const IS_DELETE_NO = 0;// 未删除
- /**
- * 支付结果类型:未分账
- */
- const PAY_WAIT = 0;
- /**
- * 支付结果类型:已分账
- */
- const PAY_SUCCESS = 1;
- /**
- * 支付结果类型:分账失败
- */
- const PAY_FAIL = 2;
- /**
- * 接收方类型:openid
- */
- const RECEIVE_OPENID = 1;
- /**
- * 接收方类型:merchant_id
- */
- const RECEIVE_MERCHANT_ID = 2;
- /**
- * 接收方类型:sub_openid
- */
- const RECEIVE_SUB_OPENID = 3;
- /**
- * 接收方类型:user id alipay
- */
- const RECEIVE_USER_ID = 4;
- /**
- * 接收方类型:login name alipay
- */
- const RECEIVE_LOGIN_NAME = 5;
- public static $validAlipayReceiveType = [
- self::RECEIVE_USER_ID => 'userId',
- self::RECEIVE_LOGIN_NAME => 'loginName'
- ];
- /**
- * 分账来源类型: 商城
- */
- const FROM_STORE = 0;
- /**
- * 分账来源类型: 平台
- */
- const FROM_PLATFORM = 1;
- /**
- * 分账来源类型: 推荐
- */
- const FROM_RECOMMEND = 2;
- /**
- * 分账来源类型: 消费返利
- */
- const FROM_SELF = 5;
- /**
- * 分账来源类型: 服务商
- */
- const FROM_SERVICE_PROVIDER = 3;
- /**
- * 分账来源类型: 商城间分销
- */
- const FROM_STORE_TO_STORE = 4;
- /**
- * 分账来源类型: 排队返利
- */
- const FROM_QUEUE = 6;
- public static $validFrom = [
- self::FROM_STORE,
- self::FROM_RECOMMEND,
- self::FROM_PLATFORM,
- self::FROM_SERVICE_PROVIDER,
- self::FROM_STORE_TO_STORE,
- self::FROM_SELF
- ];
- public static $validNewFrom = [
- self::FROM_STORE,
- self::FROM_RECOMMEND,
- self::FROM_PLATFORM,
- self::FROM_STORE_TO_STORE,
- self::FROM_SERVICE_PROVIDER,
- self::FROM_SELF
- ];
- /**
- * 分账执行方式:微信分账
- */
- const EXECUTE_TYPE_NORMAL = 0;
- /**
- * 分账执行方式:微信转账
- */
- const EXECUTE_TYPE_TRANSFER = 1;
- /**
- * 分账执行方式:支付宝分账
- */
- const EXECUTE_TYPE_ALIPAY = 2;
- /**
- * 分账执行方式:汇付分账
- */
- const EXECUTE_TYPE_HUIFU = 3;
- 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 [
- [['store_id','to_store_id','saas_id', 'execute_type', 'is_delete', 'created_at', 'updated_at', 'type', 'is_pay', 'from', 'user_id', 'is_platform','goods_id','queue_id'], 'integer'],
- [['amount', 'rate'], 'number'],
- [['name', 'description', 'account', 'transaction_id', 'order_no', 'err_code', 'err_code_des', 'order_id', 'remark', 'yunst_order_no'], 'string', 'max' => 255],
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'store_id' => 'Store ID',
- 'saas_id' =>'商盟用户id',
- 'name' => '接收方姓名',
- 'type' => '分账接收方类型,1:openid, 2:merchant_id, 3:sub_openid',
- 'description' => '分账描述',
- 'user_id' => 'USER ID',
- 'account' => '分账接收方账户',
- 'transaction_id' => '微信回执单号',
- 'order_no' => '订单号',
- 'is_pay' => '是否支付',
- 'amount' => '金额',
- 'rate' => '比例',
- 'order_id' => '请求分账后微信返回的订单id',
- 'from' => '0:店铺分销,1:saas平台分销',
- 'err_code' => '分账错误代码',
- 'err_code_des' => '分账错误信息',
- 'remark' => '标注类型,例如:店铺分销',
- 'execute_type' => '0:微信分账,1:微信转账',
- 'is_delete' => 'Is Delete',
- 'created_at' => 'Add Time',
- 'updated_at' => 'Update Time',
- 'is_platform' => "是否是平台"
- ];
- }
- }
|