You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
922 B
30 lines
922 B
<?php
|
|
|
|
namespace app\model;
|
|
|
|
class ZoneGoods extends \think\Model
|
|
{
|
|
|
|
public static function getList($param,$is_manage = false)
|
|
{
|
|
|
|
$where = $is_manage ? ['status' => 1] : [];
|
|
if (isset($param['zone_id'])) $where['zone_id'] = $param['zone_id'];
|
|
$field = 'id,title,important,price,cover_image,status';
|
|
$list = self::where($where)->field($field)->order('id desc')->select()->toArray();
|
|
foreach ($list as &$item) {
|
|
if ($item['cover_image']) $item['cover_image'] = get_image_url($item['cover_image']);
|
|
if (!$is_manage) {
|
|
unset($item['status']);
|
|
}
|
|
}
|
|
return $list;
|
|
}
|
|
|
|
public static function getFind($id)
|
|
{
|
|
#$item = self::find($id)->field('id,important,cover_image')->toArray();
|
|
#if ($item['bg_image']) $item['bg_image'] = get_image_url($item['bg_image']);
|
|
#return $item;
|
|
}
|
|
}
|