初始版本
This commit is contained in:
29
server/app/common/model/city/City.php
Executable file
29
server/app/common/model/city/City.php
Executable file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
namespace app\common\model\city;
|
||||
use app\common\model\BaseModel;
|
||||
use think\model\concern\SoftDelete;
|
||||
|
||||
/**
|
||||
* 城市关联类
|
||||
* Class City
|
||||
* @package app\common\model\city
|
||||
*/
|
||||
class City extends BaseModel
|
||||
{
|
||||
|
||||
use SoftDelete;
|
||||
|
||||
protected $deleteTime = 'delete_time';
|
||||
|
||||
/**
|
||||
* @notes 将距离转成km格式显示
|
||||
* @param $value
|
||||
* @param $data
|
||||
* @return string
|
||||
* @author cjhao
|
||||
* @date 2024/9/3 22:56
|
||||
*/
|
||||
public function getDistanceDescAttr($value,$data){
|
||||
return round($data['distance'],2).'km';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user