|
@@ -20,14 +20,30 @@ class Gift extends Api
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 获取礼物类型
|
|
|
+ */
|
|
|
+ public function getGiftType() {
|
|
|
+ // 获取基本信息
|
|
|
+ $where = [];
|
|
|
+ $where["is_show"] = 1;
|
|
|
+ $giftList = Db::name('gift_type')->field("id,name")->where($where)->order("weight","desc")->select();
|
|
|
+ $this->success("获取成功!",$giftList);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 获取礼物列表
|
|
|
*/
|
|
|
public function getGiftList() {
|
|
|
+ $type_id = input('type_id',0);
|
|
|
|
|
|
|
|
|
// 获取基本信息
|
|
|
$where = ['is_show'=>1];
|
|
|
|
|
|
+ if(!empty($type_id)){
|
|
|
+ $where['type_id'] = $type_id;
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
$giftList = Db::name('gift')->where($where)->order("weigh","desc")->select();
|
|
|
$giftList = list_domain_image($giftList,['image','special']);
|
|
@@ -173,7 +189,7 @@ class Gift extends Api
|
|
|
}
|
|
|
|
|
|
//送礼物上限
|
|
|
- public function limit_gift($giftvalue){
|
|
|
+ private function limit_gift($giftvalue){
|
|
|
$limit_info = Db::name('gift_limit')->where('level',$this->auth->wealth_level)->find();
|
|
|
if(empty($limit_info)){
|
|
|
return true;
|