ChoosePage.php
703 字节
<?php
namespace app\api\model;
use think\Model;
class ChoosePage extends Model
{
public function getImageAttr($value)
{
if ($value) $value = cdnurl($value);
return $value;
}
public function getActivitytimeAttr($value)
{
if ($value) $value = date('Y-m-d',$value);
return $value;
}
public function selectData($where,$lang)
{
$where['status'] = 1;
if ($lang == 'ch') $field = 'id,ch_title title,image';
else $field = 'id,en_title title,image';
$data = $this
->where($where)
->field($field)
->order('weigh desc')
->select();
return $data;
}
}