等级和调用支付
This commit is contained in:
parent
43d0168db0
commit
9a9c836f34
@ -7,6 +7,7 @@ use app\common\{logic\BaseLogic,
|
|||||||
model\system_store\SystemStore,
|
model\system_store\SystemStore,
|
||||||
model\user\User,
|
model\user\User,
|
||||||
model\user\UserRecharge,
|
model\user\UserRecharge,
|
||||||
|
model\user\UserShip,
|
||||||
service\wechat\WeChatMnpService};
|
service\wechat\WeChatMnpService};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -60,12 +61,20 @@ class UserLogic extends BaseLogic
|
|||||||
public static function info($uid)
|
public static function info($uid)
|
||||||
{
|
{
|
||||||
$data = User::where('id',$uid)
|
$data = User::where('id',$uid)
|
||||||
->field('avatar,real_name,nickname,account,mobile,sex,login_ip,user_money')
|
->field('avatar,real_name,nickname,account,mobile,sex,login_ip,user_money,total_recharge_amount,user_ship')
|
||||||
->find();
|
->find();
|
||||||
|
|
||||||
//判断是不是员工
|
//判断是不是员工
|
||||||
if($data){
|
if($data){
|
||||||
$data = $data->toArray();
|
$data = $data->toArray();
|
||||||
|
$all =UserShip::field('id,title,limit')->select()->toArray();
|
||||||
|
$new = self::getNextArrayByID($all,$data['user_ship']);
|
||||||
|
$data['next_level'] = '';
|
||||||
|
$data['next_limit'] = 0;
|
||||||
|
if($new){
|
||||||
|
$data['next_level'] = $new['title'];
|
||||||
|
$data['next_limit'] = $new['limit'] - $data['total_recharge_amount'];
|
||||||
|
}
|
||||||
$data['is_staff'] = 0;
|
$data['is_staff'] = 0;
|
||||||
$data['store_id'] = 0;
|
$data['store_id'] = 0;
|
||||||
if(isset($data['mobile']) && $data['mobile']){
|
if(isset($data['mobile']) && $data['mobile']){
|
||||||
@ -91,4 +100,22 @@ class UserLogic extends BaseLogic
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static function getNextArrayByID($arr, $id) {
|
||||||
|
// 遍历数组
|
||||||
|
foreach ($arr as $key => $value) {
|
||||||
|
// 检查当前数组的id是否与传入的id匹配
|
||||||
|
if ($value['id'] == $id) {
|
||||||
|
// 如果当前数组不是最后一个,则返回下一个数组
|
||||||
|
if ($key + 1 < count($arr)) {
|
||||||
|
return $arr[$key + 1];
|
||||||
|
}
|
||||||
|
// 如果当前数组是最后一个,则返回null或空数组
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 如果没有找到匹配的id,则返回null或空数组
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
@ -34,7 +34,7 @@ class PaymentLogic extends BaseLogic
|
|||||||
{
|
{
|
||||||
// 支付编号-仅为微信支付预置(同一商户号下不同客户端支付需使用唯一订单号)
|
// 支付编号-仅为微信支付预置(同一商户号下不同客户端支付需使用唯一订单号)
|
||||||
$paySn = $order['order_id'];
|
$paySn = $order['order_id'];
|
||||||
if ($order['pay_price'] == 0) {
|
if ($order['pay_price'] === 0) {
|
||||||
PayNotifyLogic::handle($from, $order['order_id']);
|
PayNotifyLogic::handle($from, $order['order_id']);
|
||||||
return ['pay_way' => PayEnum::BALANCE_PAY];
|
return ['pay_way' => PayEnum::BALANCE_PAY];
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user