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.
48 lines
1.2 KiB
48 lines
1.2 KiB
<?php
|
|
|
|
namespace app\model;
|
|
|
|
use think\Model;
|
|
use think\model\concern\SoftDelete;
|
|
|
|
class ZoneGoodsParam extends Model
|
|
{
|
|
use SoftDelete;
|
|
protected $deleteTime = 'delete_time';
|
|
|
|
/**
|
|
* 获取中奖金额
|
|
*/
|
|
public static function getAwardsAmount($id)
|
|
{
|
|
$data = self::where(['id' => $id,'awards' => 1])->field('amount')->find();
|
|
return $data ?: false;
|
|
}
|
|
|
|
/**
|
|
* 获取参数图片地址
|
|
* @param $amount
|
|
* @param $zone_goods_id
|
|
* @return string
|
|
*/
|
|
public static function getZoneParamImageUrl($amount,$zone_goods_id)
|
|
{
|
|
$image = '';
|
|
if ($amount > 0) {
|
|
|
|
$image = rand_icon('awards_icon');
|
|
|
|
$awards_icon_dirname = ZoneGoods::where('id',$zone_goods_id)->value('awards_icon_dirname');
|
|
if ($awards_icon_dirname) {
|
|
if (strpos($awards_icon_dirname,'777') !== false) {
|
|
$image = rand_icon($awards_icon_dirname);
|
|
} elseif (strpos($awards_icon_dirname,'666') !== false) {
|
|
$image = rand_icon($awards_icon_dirname);
|
|
}
|
|
}
|
|
} else {
|
|
$image = rand_icon();
|
|
}
|
|
return $image;
|
|
}
|
|
}
|