57 lines
1.4 KiB
PHP
57 lines
1.4 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Model;
|
|
|
|
use Hyperf\Database\Concerns\BuildsQueries;
|
|
use Hyperf\Database\Model\Builder;
|
|
use Hyperf\DbConnection\Model\Model;
|
|
|
|
/**
|
|
* @property int $id
|
|
* @property int $user_id
|
|
* @property int $order_id
|
|
* @property int $order_type
|
|
* @property string $order_no
|
|
* @property string $pay_money
|
|
* @property int $recharge_type
|
|
* @property int $status
|
|
* @property string $alipay_transaction_id
|
|
* @property string $wx_transaction_id
|
|
* @property string $create_time
|
|
* @property string $notify_json
|
|
*/
|
|
class PayOrder extends Model
|
|
{
|
|
/**
|
|
* The table associated with the model.
|
|
*/
|
|
protected ?string $table = 'pay_order';
|
|
|
|
/**
|
|
* The attributes that are mass assignable.
|
|
*/
|
|
protected array $fillable = [];
|
|
protected array $guarded = [];
|
|
|
|
/**
|
|
* The attributes that should be cast to native types.
|
|
*/
|
|
protected array $casts = ['id' => 'integer', 'user_id' => 'integer', 'order_id' => 'integer', 'order_type' => 'integer', 'recharge_type' => 'integer', 'status' => 'integer'];
|
|
|
|
const string CREATED_AT = 'create_time';
|
|
|
|
const null UPDATED_AT = null;
|
|
|
|
/**
|
|
* @param int $id
|
|
* @param int $type
|
|
* @return \Hyperf\Database\Model\Model|null
|
|
*/
|
|
public function getInfoByOrderIdAndType(int $id,int $type): \Hyperf\Database\Model\Model|null
|
|
{
|
|
return $this->where('order_id',$id)->where('order_type',$type)->first();
|
|
}
|
|
}
|