Commit 477a3111 by LiuJunYi

1

parent 4c6949fc
......@@ -296,7 +296,7 @@ class Project extends Base
// 正常
$project['status'] = 0;
$project['status_text'] = '立即报名';
if (strtotime($project['sign_endtime']) > time()) {
if (strtotime($project['sign_endtime']) < time()) {
// 已过期
$project['status'] = 1;
$project['status_text'] = '预约下次';
......
......@@ -156,7 +156,17 @@ class User extends Base
{
//用户UID
$uid = $this->userinfo[0];
$user = UserModel::get($uid);
$user = UserModel::get($uid)->toArray();
//过期时间
if($user['is_vip']){
if(strtotime($user['vip_endtime'])>time()){
$user['vip_endtime_str'] = '剩余'.ceil((strtotime($user['vip_endtime'])-time())/86400).'天';
}else{
$user['vip_endtime_str'] = '已到期';
}
}else{
$user['vip_endtime_str'] = '';
}
$user['hidephone'] = substr_replace($user['phone'], '****', 3, 4);
return ['code' => 0, 'msg' => 'success', 'data' => $user];
}
......
......@@ -71,20 +71,8 @@ class Order extends BaseModel
public static function getGroupNumberByProject($pid, $sign_limits)
{
//获取家庭组限制
$project = ProjectModel::get($pid);
$order = self::lock(true)
->where(['status' => config('order_status.no_pay'), 'created_at' => ['> time', date('Y-m-d H:i:s', time() - 300)]])
->whereOr('status' , 'in', [config('order_status.pay'), config('order_status.wait_comment'), config('order_status.complete')])
->select();
$count = 0;
if ($order) {
foreach ($order as $k => $v) {
if($v['type']==config('order_type.project')){
$count += $v['extras']['sign_limits'];
}
}
}
if ($count + $sign_limits > $project['sign_limits']) {
$project = ProjectModel::lock(true)->find($pid);
if ($project['sign_limits'] >= intval($project['sign_num'])+$sign_limits) {
return true;
}
return false;
......
......@@ -322,9 +322,16 @@ $config = [
// +----------------------------------------------------------------------
'wx_pay' => [
'notify_url' => '域名/api/Order/callback',
'vip_title' => '美行者会员VIP',
'vip_price' => 49.00
'notify_url' => 'https://app.maveler.com/api/Order/callback',
'vip_title' => '美行者会员VIP',
'vip_price' => 00.01,
'app_id' => 'wx1b834552a7d49bb3',
'merchant_id' => '1515838821',
'sign_type' => 'MD5',
'key' => 'meixingzheqinziyou2018jqtechgzgy',
'app_secret' => '9708059f5f0a280bea0779df44389231',
'ssl_cert_path' => '',
'ssl_key_path' => ''
],
];
......
......@@ -2,7 +2,7 @@
require_once "WxPay.Exception.php";
require_once "WxPay.Config.Interface.php";
require_once "WxPay.Data.php";
require_once "WxPay.Config.php";
require_once "Config.php";
/**
*
......
......@@ -33,7 +33,7 @@ class WxPayConfig extends WxPayConfigInterface
}
public function GetMerchantId()
{
return config('wx_pay.erchant_id');
return config('wx_pay.merchant_id');
}
//=======【支付相关配置:支付成功回调地址/签名方式】===================================
......
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