Commit 695ebe14 by 冷斌

fix bug

parent 560b45f4
......@@ -1578,8 +1578,9 @@ class Api_Live extends PhalApi_Api {
$key='getGiftList';
$giftlist=getcaches($key);
$domain = new Domain_Live();
if(!$giftlist){
$domain = new Domain_Live();
$giftlist=$domain->getGiftList();
setcaches($key,$giftlist);
}
......@@ -1590,15 +1591,18 @@ class Api_Live extends PhalApi_Api {
}
}
$giftlist = $data;
$welfare = DI()->notorm->welfare_rate->select('rate')->where('id=1')->fetchOne();
$info['welfare_price'] = $welfare['rate'];
$giftlist[] = [
'type' => 0,
'mark' => 4,
'giftname' => '宝箱',
'needcoin' => $welfare['rate'],
];
$welfareGift = $domain->randomGift();
if (!empty($welfareGift)) {
$welfare = DI()->notorm->welfare_rate->select('rate')->where('id=1')->fetchOne();
$info['welfare_price'] = $welfare['rate'];
$giftlist[] = [
'type' => 0,
'mark' => 4,
'giftname' => '宝箱',
'needcoin' => $welfare['rate'],
];
}
$domain2 = new Domain_User();
$coin=$domain2->getBalance($uid);
......
......@@ -234,4 +234,12 @@ class Domain_Live {
$rs = $model->weekList($types,$gid,$p);
return $rs;
}
public function randomGift()
{
$rs = array();
$model = new Model_Live();
$rs = $model->randomGift();
return $rs;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment