coupon-admin/app/model/BusinessCircle.php

35 lines
746 B
PHP
Raw Normal View History

2021-11-29 06:00:37 +00:00
<?php
namespace app\model;
use think\Collection;
use think\db\exception\DataNotFoundException;
use think\db\exception\DbException;
use think\db\exception\ModelNotFoundException;
2021-11-29 09:32:48 +00:00
use think\Model;
2021-11-29 06:00:37 +00:00
/**
* 商圈
* Class BusinessCircle
* @package app\model
*/
class BusinessCircle extends Base
{
2021-11-29 09:32:48 +00:00
/**
* 获取全部列表
*
* @return Disease[]|array|Collection
* @throws DataNotFoundException
* @throws DbException
* @throws ModelNotFoundException
*/
public static function getList()
{
2022-04-21 09:18:54 +00:00
return self::field('id,name,sort')->order(["sort"=>"desc",'id'=>'desc'])->select();
2021-11-29 09:32:48 +00:00
}
public static function onAfterInsert($obj)
{
$obj->sort = $obj->id;
$obj->save();
}
2021-11-29 06:00:37 +00:00
}