quguofeng 1 year ago
parent
commit
5f2cc4b1d1
1 changed files with 4 additions and 2 deletions
  1. 4 2
      application/api/controller/User.php

+ 4 - 2
application/api/controller/User.php

@@ -189,6 +189,8 @@ class User extends Api
                 ];
                 Like::insert($look);
                 UserModel::money(-$cost,$uid,'解锁喜欢我的资料');
+                //发送微信模板消息
+                Apply::wxUnlockMessage($uid,$nid,Date('Y-m-d H:i:s'),2);
                 Db::commit();
                 $this->success('解锁成功');
             }catch (Exception $e){
@@ -215,6 +217,8 @@ class User extends Api
                 ];
                 Like::insert($look);
                 UserModel::money(-$cost,$uid,'解锁访客资料');
+                //发送微信模板消息
+                Apply::wxUnlockMessage($uid,$nid,Date('Y-m-d H:i:s'),2);
                 Db::commit();
                 $this->success('解锁成功');
             }catch (Exception $e){
@@ -223,8 +227,6 @@ class User extends Api
                 return false;
             }
         }
-        //发送微信模板消息
-        Apply::wxUnlockMessage($uid,$nid,Date('Y-m-d H:i:s'),2);
     }
     /**
      * 申请我的操作