init: 项目初始代码
This commit is contained in:
35
app/api/model/GoodsCoupon.php
Normal file
35
app/api/model/GoodsCoupon.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user