作者 Cool
1 个管道 的构建 通过 耗费 1 秒

Merge branch 'master' of http://114.215.101.231:8099/guosheng/community into Branch_liuzhen

@@ -701,6 +701,7 @@ class User extends Api @@ -701,6 +701,7 @@ class User extends Api
701 "data": [{ 701 "data": [{
702 "memo": "测试", //标题 702 "memo": "测试", //标题
703 "money": "10.00", //金额 703 "money": "10.00", //金额
  704 + "status": 0, //状态:0=无状态,1=审核中,2=审核通过,3=审核失败
704 "createtime": "2020-08-29 17:07:56" // 时间 705 "createtime": "2020-08-29 17:07:56" // 时间
705 }] 706 }]
706 }) 707 })
@@ -712,7 +713,7 @@ class User extends Api @@ -712,7 +713,7 @@ class User extends Api
712 $where = ['user_id'=>$this->auth->id]; 713 $where = ['user_id'=>$this->auth->id];
713 $total_num = UserMoneyLog::where($where)->count(); 714 $total_num = UserMoneyLog::where($where)->count();
714 $list = UserMoneyLog::where($where) 715 $list = UserMoneyLog::where($where)
715 - ->field("memo,money,from_unixtime(createtime, '%Y-%m-%d %H:%i:%S') createtime") 716 + ->field("memo,money,status,from_unixtime(createtime, '%Y-%m-%d %H:%i:%S') createtime")
716 ->page($page,$pageNum) 717 ->page($page,$pageNum)
717 ->order('createtime','DESC') 718 ->order('createtime','DESC')
718 ->select(); 719 ->select();
@@ -16,6 +16,7 @@ use think\Db; @@ -16,6 +16,7 @@ use think\Db;
16 use app\common\controller\Frontend; 16 use app\common\controller\Frontend;
17 use app\api\model\UserHouse; 17 use app\api\model\UserHouse;
18 use app\api\model\House; 18 use app\api\model\House;
  19 +use app\api\model\HousePhone;
19 20
20 /** 21 /**
21 * 微信接口 22 * 微信接口
@@ -91,11 +92,23 @@ class Wechat extends Frontend @@ -91,11 +92,23 @@ class Wechat extends Frontend
91 private function joinHouse($house_id,$openid){ 92 private function joinHouse($house_id,$openid){
92 $user = WechatService::getUserByOpenid($openid); 93 $user = WechatService::getUserByOpenid($openid);
93 $house = House::get($house_id); 94 $house = House::get($house_id);
  95 + // 发送内容
  96 + $content = "欢迎关注{$house['name']}!";
  97 + $phoneList = HousePhone::where('house_id',$house_id)->select();
  98 + if(!empty($phoneList)){
  99 + $content .= "\n";
  100 + foreach ($phoneList as $v) {
  101 + $content .= "\n"."{$v['name']}:{$v['phone']}";
  102 + }
  103 + }
  104 + $content .= "\n\n"."业主账号:%u"
  105 + ."\n\n"."<a href='https://weixin.qq.com/'>查看物业公告</a>"
  106 + ."\n\n"."<a href='https://weixin.qq.com/'>给物业留言</a>";
94 //*------------------------已有账号,直接加入小区-----------------------*/ 107 //*------------------------已有账号,直接加入小区-----------------------*/
95 if($user){ 108 if($user){
96 $info = UserHouse::get(['user_id'=>$user['id'],'house_id'=>$house_id]); 109 $info = UserHouse::get(['user_id'=>$user['id'],'house_id'=>$house_id]);
97 if(!empty($info) && $info['status'] == 2){ 110 if(!empty($info) && $info['status'] == 2){
98 - return "您已加入【{$house['name']}】社区"; 111 + return sprintf($content,$user['id_num']);
99 } 112 }
100 Db::startTrans(); 113 Db::startTrans();
101 try { 114 try {
@@ -128,7 +141,7 @@ class Wechat extends Frontend @@ -128,7 +141,7 @@ class Wechat extends Frontend
128 Db::rollback(); 141 Db::rollback();
129 return $e->getMessage(); 142 return $e->getMessage();
130 } 143 }
131 - return "您已成功加入【{$house['name']}】社区"; 144 + return sprintf($content,$user['id_num']);
132 } 145 }
133 /*------------------------没有账号,先注册,后加入小区-----------------------*/ 146 /*------------------------没有账号,先注册,后加入小区-----------------------*/
134 $access_token = WechatService::getAccessToken(); 147 $access_token = WechatService::getAccessToken();
@@ -180,7 +193,7 @@ class Wechat extends Frontend @@ -180,7 +193,7 @@ class Wechat extends Frontend
180 Db::rollback(); 193 Db::rollback();
181 return $e->getMessage(); 194 return $e->getMessage();
182 } 195 }
183 - return "您已加入【{$house['name']}】社区"; 196 + return sprintf($content,$user['id_num']);
184 } 197 }
185 198
186 } 199 }