| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182 |
- <?php
- namespace addons\AvoidTax\common\models;
- use common\models\user\UserWithdrawLog as UserUserWithdrawLog;
- use yii\helpers\Json;
- /**
- * UserWithdrawLog class
- * @package addons\AvoidTax\common\models
- */
- class UserWithdrawLog extends UserUserWithdrawLog
- {
- /**
- * 获取申请中的合规提现记录
- *
- * @param integer $mall_id
- * @param integer $id
- * @return UserWithdrawLog|array|null a single row of query result. Depending on the setting of [[asArray]],
- */
- public static function getTaxLogByAgree(int $mall_id, int $id)
- {
- return static::find()
- ->where([
- 'id' => $id,
- 'mall_id' => $mall_id,
- 'status' => UserWithdrawLog::STATUS_AGREE,
- 'type' => 'alipay_tax'
- ])
- ->one();
- }
- /**
- * 获取申请中的合规提现记录
- *
- * @param integer $mall_id
- * @param integer $id
- * @return UserWithdrawLog|array|null a single row of query result. Depending on the setting of [[asArray]],
- */
- public static function getTaxLogByAgreeOrWait(int $mall_id, int $id)
- {
- return static::find()
- ->where([
- 'id' => $id,
- 'mall_id' => $mall_id,
- 'status' => [UserWithdrawLog::STATUS_AGREE, UserWithdrawLog::STATUS_WAIT],
- 'type' => 'alipay_tax'
- ])
- ->one();
- }
- /**
- * 获取申请中的合规提现记录集合
- *
- * @param integer $mall_id
- * @param array $ids
- * @return array|UserWithdrawLog[] the query results. If the query results in nothing, an empty array will be returned.
- */
- public static function getTaxLogsByAgree(int $mall_id, array $ids)
- {
- return static::find()
- ->where(['id' => $ids, 'mall_id' => $mall_id, 'status' => UserWithdrawLog::STATUS_AGREE, 'type' => 'alipay_tax'])
- ->all();
- }
- /**
- * 获取支付宝信息
- *
- * @return array [name, mobile, id_card]
- */
- public function getExtra()
- {
- $extra = Json::decode($this->extra);
- $name = !empty($extra['name']) ? $extra['name'] : '';
- $mobile = !empty($extra['mobile']) ? $extra['mobile'] : '';
- $id_card = !empty($extra['id_card']) ? $extra['id_card'] : '';
- return [$name, $mobile, $id_card];
- }
- }
|