新需求-活动需求-天降首充好礼调整-后台接口调整
This commit is contained in:
@@ -40,8 +40,9 @@ class Activities extends adminApi
|
|||||||
public function first_charge_lists(){
|
public function first_charge_lists(){
|
||||||
$page = input('page', 1);
|
$page = input('page', 1);
|
||||||
$page_limit = input('page_limit', 30);
|
$page_limit = input('page_limit', 30);
|
||||||
|
$activities_id = input('activities_id', 1);
|
||||||
$where = [];
|
$where = [];
|
||||||
$where['activities_id'] = 1;
|
$where['activities_id'] = $activities_id;
|
||||||
$where['delete_time'] = 0;
|
$where['delete_time'] = 0;
|
||||||
$count = db($this->table)->where($where)->count();
|
$count = db($this->table)->where($where)->count();
|
||||||
$lists = db($this->table)->where($where)->page($page, $page_limit)->select();
|
$lists = db($this->table)->where($where)->page($page, $page_limit)->select();
|
||||||
@@ -76,11 +77,12 @@ class Activities extends adminApi
|
|||||||
$title1 = input('title1', '');
|
$title1 = input('title1', '');
|
||||||
$title2 = input('title2', '');
|
$title2 = input('title2', '');
|
||||||
$money = input('money', '');
|
$money = input('money', '');
|
||||||
|
$activities_id = input('activities_id', 1);
|
||||||
$return_data = [
|
$return_data = [
|
||||||
'name' => $name,
|
'name' => $name,
|
||||||
'title' => $title,
|
'title' => $title,
|
||||||
'status' => $status,
|
'status' => $status,
|
||||||
'activities_id' => 1,
|
'activities_id' => $activities_id,
|
||||||
];
|
];
|
||||||
$ext = [
|
$ext = [
|
||||||
'title1' => $title1,
|
'title1' => $title1,
|
||||||
@@ -167,11 +169,12 @@ class Activities extends adminApi
|
|||||||
$page_limit = input('page_limit', 30);
|
$page_limit = input('page_limit', 30);
|
||||||
$user_id = input('user_id', '');
|
$user_id = input('user_id', '');
|
||||||
$gift_bag_id = input('gift_bag_id', '');
|
$gift_bag_id = input('gift_bag_id', '');
|
||||||
|
$activities_id = input('activities_id', 1);
|
||||||
$where = [];
|
$where = [];
|
||||||
if($user_id){
|
if($user_id){
|
||||||
$where['user_id'] = $user_id;
|
$where['user_id'] = $user_id;
|
||||||
}
|
}
|
||||||
$gift_bag = db('vs_gift_bag')->where(['activities_id'=>1,'delete_time'=>0])->select();
|
$gift_bag = db('vs_gift_bag')->where(['activities_id'=>$activities_id,'delete_time'=>0])->select();
|
||||||
|
|
||||||
if($gift_bag_id){
|
if($gift_bag_id){
|
||||||
$where['gift_bag_id'] = $gift_bag_id;
|
$where['gift_bag_id'] = $gift_bag_id;
|
||||||
|
|||||||
@@ -26,6 +26,9 @@ class Payment extends Controller
|
|||||||
$user_id = input('user_id', 0);
|
$user_id = input('user_id', 0);
|
||||||
$money = input('money', 0);
|
$money = input('money', 0);
|
||||||
$coin = input('coin', 0);
|
$coin = input('coin', 0);
|
||||||
|
$type_params = input('type_params', 0);
|
||||||
|
$type_id = input('type_id', 0);
|
||||||
|
|
||||||
if(!$coin){
|
if(!$coin){
|
||||||
$coin = $money * get_system_config_value('rmb_coin_ratio');
|
$coin = $money * get_system_config_value('rmb_coin_ratio');
|
||||||
}
|
}
|
||||||
@@ -60,7 +63,9 @@ class Payment extends Controller
|
|||||||
$data['user_id'] = $user_id;
|
$data['user_id'] = $user_id;
|
||||||
$data['pay_type'] = $type;
|
$data['pay_type'] = $type;
|
||||||
$data['createtime'] = time();
|
$data['createtime'] = time();
|
||||||
$data['remarke'] = '充值到app用户'.($user_code ?? "") ."余额!";;
|
$data['remarke'] = '充值到app用户'.($user_code ?? "") ."余额!";
|
||||||
|
$data['type_params'] = $type_params;
|
||||||
|
$data['type_id'] = $type_id;
|
||||||
|
|
||||||
$re = db::name('vs_user_recharge')->insert($data);
|
$re = db::name('vs_user_recharge')->insert($data);
|
||||||
if (!$re) {
|
if (!$re) {
|
||||||
|
|||||||
@@ -1198,13 +1198,19 @@ function handelCharge($where,$data){
|
|||||||
}
|
}
|
||||||
db::commit();
|
db::commit();
|
||||||
|
|
||||||
|
//活动
|
||||||
//首充
|
//首充
|
||||||
if($is_first_charge == 0){
|
if($is_first_charge == 0){
|
||||||
model('Activities')->first_charge_gift_send($orderModel['user_id'],$orderModel['money']);
|
model('Activities')->first_charge_gift_send($orderModel['user_id'],$orderModel['money']);
|
||||||
}
|
}
|
||||||
//天降好礼
|
switch ($orderModel['type_params']){
|
||||||
model('Activities')->drop_gift_send($orderModel['user_id'],$orderModel['money']);
|
case 2:
|
||||||
|
//天降好礼
|
||||||
|
model('Activities')->drop_gift_send($orderModel['user_id'],$orderModel['money']);
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
//新人好礼
|
||||||
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
} catch (\Exception $e){
|
} catch (\Exception $e){
|
||||||
|
|||||||
Reference in New Issue
Block a user