Files
hyperf_service/app/Model/CouponTemplate.php
2025-02-25 18:01:14 +08:00

50 lines
1.2 KiB
PHP

<?php
declare(strict_types=1);
namespace App\Model;
use Hyperf\DbConnection\Model\Model;
/**
* @property int $id
* @property string $name
* @property int $coupon_type
* @property string $amount
* @property string $ratio
* @property int $is_admin_edit
* @property int $status
* @property string $create_time
* @property string $update_time
*/
class CouponTemplate extends Model
{
/**
* The table associated with the model.
*/
protected ?string $table = 'coupon_template';
/**
* 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', 'coupon_type' => 'integer', 'is_admin_edit' => 'integer', 'status' => 'integer'];
const string CREATED_AT = 'created_time';
const string UPDATED_AT = 'updated_time';
/**
* @param int $id
* @return CouponTemplate|\Hyperf\Database\Model\Model|array|null
*/
public function getInfoById(int $id): CouponTemplate|\Hyperf\Database\Model\Model|array|null
{
return $this->find($id);
}
}