| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- <?php
- namespace addons\YunfastPay\common\models;
- use Yii;
- /**
- * This is the model class for table "{{%addons_yunfast_pay_splitbill_item}}".
- *
- * @property int $id
- * @property int $mall_id
- * @property int $log_id 分账记录ID
- * @property int $store_id 店铺ID
- * @property float $amount 分账金额
- * @property string|null $role 分账角色
- * @property string|null $mcht_cd 接收方商户号
- * @property int|null $fee_party 手续费承担方,只能有一方承担,是 0:否,1:是,部分通道不支持
- * @property int $updated_at
- * @property int $created_at
- */
- class SplitbillItem extends ActiveRecord
- {
- /**
- * {@inheritdoc}
- */
- public static function tableName()
- {
- return '{{%addons_yunfast_pay_splitbill_item}}';
- }
- /**
- * {@inheritdoc}
- */
- public function rules()
- {
- return [
- [['mall_id', 'log_id', 'store_id'], 'required'],
- [['mall_id', 'log_id', 'store_id', 'fee_party', 'updated_at', 'created_at'], 'integer'],
- [['amount'], 'number'],
- [['role', 'mcht_cd'], 'string', 'max' => 32],
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'mall_id' => 'Mall ID',
- 'log_id' => 'Log ID',
- 'store_id' => 'Store ID',
- 'amount' => 'Amount',
- 'role' => 'Role',
- 'mcht_cd' => 'Mcht Cd',
- 'fee_party' => 'Fee Party',
- 'updated_at' => 'Updated At',
- 'created_at' => 'Created At',
- ];
- }
- /**
- * @param integer $id
- * @return static|null
- */
- public static function getLogById(int $id)
- {
- return static::find()
- ->where(['id' => $id])
- ->one();
- }
- /**
- * 是否有代付订单
- *
- * @return boolean
- */
- public function hasAgentOrder()
- {
- return !empty(AgentOrder::find()
- ->where(['withdraw_id' => $this->id])
- ->select('id')
- ->one())
- ? true
- : false;
- }
- }
|