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.
35 lines
1.2 KiB
35 lines
1.2 KiB
<?php
|
|
|
|
namespace app\model;
|
|
|
|
use app\common\lib\pinyin\PinyinNumber;
|
|
|
|
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,max_awards_amount,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']);
|
|
$item['max_awards_amount'] = PinyinNumber::getChinese($item['max_awards_amount'],'元');
|
|
if ($is_manage) {
|
|
$item['important'] = '最高中奖金额'.format_money($item['max_awards_amount']);
|
|
unset($item['status']);
|
|
unset($item['max_awards_amount']);
|
|
}
|
|
}
|
|
return $list;
|
|
}
|
|
|
|
public static function getFind($id)
|
|
{
|
|
#$item = self::find($id)->field('id,max_awards_amount,cover_image')->toArray();
|
|
#if ($item['bg_image']) $item['bg_image'] = get_image_url($item['bg_image']);
|
|
#return $item;
|
|
}
|
|
}
|