Files
ntonpower/app/api/model/GoodsCoupon.php
2026-10-14 14:00:29 +08:00

36 lines
789 B
PHP

<?php
namespace app\api\model;
use think\Model;
/**
* 优惠券模型
* @mixin \think\Model
*/
class GoodsCoupon extends BaseModel
{
protected $schema = [
'id' =>'int',
'platform_id' =>'int',
'language_id' =>'int',
'site_id' =>'int',
'old_code' =>'string',
'new_code' =>'string',
'create_time' =>'int',
'update_time' =>'int',
];
/**
*
* @param $data
* @return array|Model|void|null
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\DbException
* @throws \think\db\exception\ModelNotFoundException
*/
public function getLatest($data)
{
return $this->order($this->pk,'desc')->where($data)->find();
}
}