定版之后bug修改----抽奖重构。
This commit is contained in:
@@ -593,10 +593,10 @@ class Activities extends adminApi
|
|||||||
$lists[$key]['gift_id'] = $value['foreign_id'];
|
$lists[$key]['gift_id'] = $value['foreign_id'];
|
||||||
$lists[$key]['gift_name'] = $value['name'];
|
$lists[$key]['gift_name'] = $value['name'];
|
||||||
$gift_data = db::name('vs_gift')->where(['gid' => $value['foreign_id']])->find();
|
$gift_data = db::name('vs_gift')->where(['gid' => $value['foreign_id']])->find();
|
||||||
$lists[$key]['base_image'] = $gift_data['base_image'];
|
$lists[$key]['base_image'] = $gift_data['base_image']??"";
|
||||||
$lists[$key]['quantity'] = $value['quantity'];
|
$lists[$key]['quantity'] = $value['quantity'];
|
||||||
$lists[$key]['quantity_str'] = $value['quantity']."个";
|
$lists[$key]['quantity_str'] = $value['quantity']."个";
|
||||||
$lists[$key]['gift_price'] = $gift_data['gift_price'];
|
$lists[$key]['gift_price'] = $gift_data['gift_price']?? "";
|
||||||
}elseif ($value['type'] == 3){
|
}elseif ($value['type'] == 3){
|
||||||
$lists[$key]['gift_id'] = $value['foreign_id'];
|
$lists[$key]['gift_id'] = $value['foreign_id'];
|
||||||
$lists[$key]['gift_name'] = $value['name'];
|
$lists[$key]['gift_name'] = $value['name'];
|
||||||
|
|||||||
@@ -159,7 +159,7 @@ class Underage extends adminApi
|
|||||||
*/
|
*/
|
||||||
public function content_List(){
|
public function content_List(){
|
||||||
$page = input('page', 1);
|
$page = input('page', 1);
|
||||||
$page_limit = input('pageSize', 30);
|
$page_limit = input('page_limit', 10);
|
||||||
$search_name = input('search_name', '');
|
$search_name = input('search_name', '');
|
||||||
$where = [];
|
$where = [];
|
||||||
if($search_name){
|
if($search_name){
|
||||||
@@ -167,6 +167,7 @@ class Underage extends adminApi
|
|||||||
}
|
}
|
||||||
$list = DB::name('vs_underage_mode_content')->where($where)->order('sort,id', 'asc')->page($page, $page_limit)->select();
|
$list = DB::name('vs_underage_mode_content')->where($where)->order('sort,id', 'asc')->page($page, $page_limit)->select();
|
||||||
$count = DB::name('vs_underage_mode_content')->where($where)->count();
|
$count = DB::name('vs_underage_mode_content')->where($where)->count();
|
||||||
|
$return_lists = [];
|
||||||
foreach ($list as $key => $value) {
|
foreach ($list as $key => $value) {
|
||||||
$return_lists[$key]['id'] = $value['id'];
|
$return_lists[$key]['id'] = $value['id'];
|
||||||
$return_lists[$key]['type_id'] = $value['type_id'];
|
$return_lists[$key]['type_id'] = $value['type_id'];
|
||||||
@@ -266,7 +267,7 @@ class Underage extends adminApi
|
|||||||
$type_id = input('type_id', '');
|
$type_id = input('type_id', '');
|
||||||
$title = input('title', '');
|
$title = input('title', '');
|
||||||
$introduced = input('introduced', '');
|
$introduced = input('introduced', '');
|
||||||
$content = input('content', '');
|
$content = $_POST['content']??"";
|
||||||
$url = input('url', '');
|
$url = input('url', '');
|
||||||
$img = input('img', '');
|
$img = input('img', '');
|
||||||
$from = input('from', 1);
|
$from = input('from', 1);
|
||||||
@@ -303,9 +304,6 @@ class Underage extends adminApi
|
|||||||
$data['content'] = $content;
|
$data['content'] = $content;
|
||||||
}
|
}
|
||||||
$result = db::name('vs_underage_mode_content')->where(['id'=>$id])->update($data);
|
$result = db::name('vs_underage_mode_content')->where(['id'=>$id])->update($data);
|
||||||
if(!$result){
|
|
||||||
return V(0,"修改失败");
|
|
||||||
}
|
|
||||||
return V(1,"成功", ['id'=>$id]);
|
return V(1,"成功", ['id'=>$id]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -39,7 +39,7 @@ class BlindBoxTurntable extends BaseCom
|
|||||||
$gift_user_ids = input('gift_user_ids',0);
|
$gift_user_ids = input('gift_user_ids',0);
|
||||||
$num = input('num',1);
|
$num = input('num',1);
|
||||||
$heart_id = input('heart_id',0);
|
$heart_id = input('heart_id',0);
|
||||||
$reslut = model('BlindBoxTurntableGift')->draw_gift($gift_bag_id, $user_id, $gift_user_ids,$num,$room_id,$heart_id);
|
$reslut = model('BlindBoxTurntableGiftDraw')->draw_gift($gift_bag_id, $user_id, $gift_user_ids,$num,$room_id,$heart_id);
|
||||||
return v($reslut['code'], $reslut['msg'], $reslut['data']);
|
return v($reslut['code'], $reslut['msg'], $reslut['data']);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
@@ -92,7 +92,7 @@ class BlindBoxTurntable extends BaseCom
|
|||||||
$user_id = $this->uid;
|
$user_id = $this->uid;
|
||||||
$room_id = input('room_id',0);
|
$room_id = input('room_id',0);
|
||||||
$num = input('num',1);
|
$num = input('num',1);
|
||||||
$reslut = model('BlindBoxTurntableGift')->xlh_draw_gift($user_id,$num,$room_id);
|
$reslut = model('BlindBoxTurntableGiftDraw')->xlh_draw_gift($user_id,$num,$room_id);
|
||||||
return v($reslut['code'], $reslut['msg'], $reslut['data']);
|
return v($reslut['code'], $reslut['msg'], $reslut['data']);
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
|
|||||||
1470
application/api/model/BlindBoxTurntableGiftDraw.php
Normal file
1470
application/api/model/BlindBoxTurntableGiftDraw.php
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user