eee
This commit is contained in:
+73
-73
@@ -10,93 +10,93 @@ namespace wchat\qq\result;
|
||||
class RedHatResult
|
||||
{
|
||||
|
||||
public mixed $result;
|
||||
public mixed $res_info;
|
||||
public mixed $result;
|
||||
public mixed $res_info;
|
||||
|
||||
public mixed $listid;
|
||||
public mixed $state;
|
||||
public mixed $total_num;
|
||||
public mixed $recv_num;
|
||||
public mixed $total_amount;
|
||||
public mixed $recv_amount;
|
||||
public mixed $recv_details;
|
||||
public mixed $uin;
|
||||
public mixed $listid;
|
||||
public mixed $state;
|
||||
public mixed $total_num;
|
||||
public mixed $recv_num;
|
||||
public mixed $total_amount;
|
||||
public mixed $recv_amount;
|
||||
public mixed $recv_details;
|
||||
public mixed $uin;
|
||||
|
||||
|
||||
const RED_HAT_STATUS_PAID = 1;
|
||||
const RED_HAT_STATUS_SNATCHED = 2;
|
||||
const RED_HAT_STATUS_EXPIRED = 3;
|
||||
const RED_HAT_STATUS_REFUNDED = 4;
|
||||
const RED_HAT_STATUS_PAID = 1;
|
||||
const RED_HAT_STATUS_SNATCHED = 2;
|
||||
const RED_HAT_STATUS_EXPIRED = 3;
|
||||
const RED_HAT_STATUS_REFUNDED = 4;
|
||||
|
||||
|
||||
/**
|
||||
* RedHatResult constructor.
|
||||
* @param array $array
|
||||
*/
|
||||
public function __construct(array $array)
|
||||
{
|
||||
$this->init($array);
|
||||
}
|
||||
/**
|
||||
* RedHatResult constructor.
|
||||
* @param array $array
|
||||
*/
|
||||
public function __construct(array $array)
|
||||
{
|
||||
$this->init($array);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $array
|
||||
* @return void
|
||||
*/
|
||||
private function init($array): void
|
||||
{
|
||||
foreach ($array as $key => $value) {
|
||||
if (!property_exists($this, $key)) {
|
||||
continue;
|
||||
}
|
||||
$this->{$key} = $value;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* @param array $array
|
||||
* @return void
|
||||
*/
|
||||
private function init(array $array): void
|
||||
{
|
||||
foreach ($array as $key => $value) {
|
||||
if (!property_exists($this, $key)) {
|
||||
continue;
|
||||
}
|
||||
$this->{$key} = $value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param $field
|
||||
* @return mixed
|
||||
*/
|
||||
public function get($field): mixed
|
||||
{
|
||||
return $this->$field;
|
||||
}
|
||||
/**
|
||||
* @param string $field
|
||||
* @return mixed
|
||||
*/
|
||||
public function get(string $field): mixed
|
||||
{
|
||||
return $this->$field;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
* 是否已完成支付
|
||||
*/
|
||||
public function isPaid(): bool
|
||||
{
|
||||
return $this->state == self::RED_HAT_STATUS_PAID;
|
||||
}
|
||||
/**
|
||||
* @return bool
|
||||
* 是否已完成支付
|
||||
*/
|
||||
public function isPaid(): bool
|
||||
{
|
||||
return $this->state == self::RED_HAT_STATUS_PAID;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
* 是否已抢完
|
||||
*/
|
||||
public function isSnatched(): bool
|
||||
{
|
||||
return $this->state == self::RED_HAT_STATUS_SNATCHED;
|
||||
}
|
||||
/**
|
||||
* @return bool
|
||||
* 是否已抢完
|
||||
*/
|
||||
public function isSnatched(): bool
|
||||
{
|
||||
return $this->state == self::RED_HAT_STATUS_SNATCHED;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function isExpired(): bool
|
||||
{
|
||||
return $this->state == self::RED_HAT_STATUS_EXPIRED;
|
||||
}
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function isExpired(): bool
|
||||
{
|
||||
return $this->state == self::RED_HAT_STATUS_EXPIRED;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function isRefunded(): bool
|
||||
{
|
||||
return $this->state == self::RED_HAT_STATUS_REFUNDED;
|
||||
}
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function isRefunded(): bool
|
||||
{
|
||||
return $this->state == self::RED_HAT_STATUS_REFUNDED;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user