xiaogang 3 年之前
父节点
当前提交
6d58e340fb

+ 0 - 6
app/Admin/Actions/Users/UsersInfoForm.php

xqd
@@ -34,13 +34,7 @@ class UsersInfoForm extends Form implements LazyRenderable
             $user_info = UserInfoModel::query()->where('user_id',$this->payload['user_id'])->first();
             $this->fill($user_info);
         }
-//        else{
-//            dd(222222);
-//        }
 
-
-//        $user_info = UserInfoModel::query()->where('user_id',$this->payload['user_id'])->first();
-//        $this->fill($user_info);
         $this->text('user_id',"用户ID")->readOnly();
         $this->text('nickname', '昵称')->required();
         $this->image('avatar', '头像')->disk('oss')->saveFullUrl()->uniqueName()->removable(false);

+ 5 - 0
app/Helper/function.php

xqd
@@ -181,3 +181,8 @@ function rad($d)
     return $d * M_PI / 180.0;
 }
 
+//获取vip配置内容
+function get_vip_config($key){
+   return \App\Models\VipConfig::query()->where('id',2)->value($key);
+}
+

+ 1 - 1
app/Services/DynamicService.php

xqd
@@ -40,7 +40,7 @@ class DynamicService
             throw new VipException("开通VIP即可发布动态");
         }else{
             $limit = UserVipLimit::query()->where('user_id',$user->id)->first();
-            if($limit->dynamic>=5){
+            if($limit->dynamic>=get_vip_config("dynamic")){
                 throw new Exception("每天只能发布5条");
             }else{
                 //增加记录

+ 1 - 1
app/Services/HomeService.php

xqd
@@ -257,7 +257,7 @@ class HomeService
             throw new VipException("开通VIP即可解锁");
         }else{
             $limit = UserVipLimit::query()->where('user_id',$user->id)->first();
-            if($limit->weixin>=10){
+            if($limit->weixin>=get_vip_config("weixin")){
                 throw new Exception("每天只能解锁10次");
             }else{
                 //增加记录