作者 何书鹏
1 个管道 的构建 通过 耗费 1 秒

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

@@ -136,6 +136,8 @@ class Hot extends Api @@ -136,6 +136,8 @@ class Hot extends Api
136 $list = $inform->items(); 136 $list = $inform->items();
137 $view_model = new StoreInformView(); 137 $view_model = new StoreInformView();
138 foreach ($list as &$v) { 138 foreach ($list as &$v) {
  139 + // 发布时间调整
  140 + $v['createtime'] = tranTime(strtotime($v['createtime']));
139 // 获取点赞数及是否点赞 141 // 获取点赞数及是否点赞
140 $where_g = [ 142 $where_g = [
141 'object_id' => $v['id'] 143 'object_id' => $v['id']
@@ -494,7 +496,7 @@ class Hot extends Api @@ -494,7 +496,7 @@ class Hot extends Api
494 "remark" => '', 496 "remark" => '',
495 ); 497 );
496 $openid = Db::name('third')->where('user_id',$store['user_id'])->value('openid'); 498 $openid = Db::name('third')->where('user_id',$store['user_id'])->value('openid');
497 - $url = config('option.vue_url') . '/messageto?id='.$msg_id; 499 + $url = config('option.vue_url') . '/messageto?is_template=1&id='.$msg_id;
498 $this->wxsendmessage($openid,$send_data,config('option.template')['msg'],$url); 500 $this->wxsendmessage($openid,$send_data,config('option.template')['msg'],$url);
499 Db::commit(); 501 Db::commit();
500 } catch (PDOException $e) { 502 } catch (PDOException $e) {
@@ -791,7 +791,7 @@ class HouseAdmin extends Api @@ -791,7 +791,7 @@ class HouseAdmin extends Api
791 "remark" => '', 791 "remark" => '',
792 ); 792 );
793 $openid = Db::name('third')->where('user_id',$msg['user_id'])->value('openid'); 793 $openid = Db::name('third')->where('user_id',$msg['user_id'])->value('openid');
794 - $url = config('option.vue_url') . '/messagelk?house_id='.$msg['object_id'].'&user_id='.$msg['object_user_id']; 794 + $url = config('option.vue_url') . '/messagelk?is_template=1&house_id='.$msg['object_id'].'&user_id='.$msg['object_user_id'];
795 $this->wxsendmessage($openid,$send_data,config('option.template')['msg'],$url); 795 $this->wxsendmessage($openid,$send_data,config('option.template')['msg'],$url);
796 Db::commit(); 796 Db::commit();
797 } catch (PDOException $e) { 797 } catch (PDOException $e) {
@@ -407,7 +407,7 @@ class HouseBoard extends Api @@ -407,7 +407,7 @@ class HouseBoard extends Api
407 "remark" => '', 407 "remark" => '',
408 ); 408 );
409 $openid = Db::name('third')->where('user_id',$param['house_user_id'])->value('openid'); 409 $openid = Db::name('third')->where('user_id',$param['house_user_id'])->value('openid');
410 - $url = config('option.vue_url') . '/liuyanxiaoxi?id='.$param['house_user_id']; 410 + $url = config('option.vue_url') . '/liuyanxiaoxi?is_template=1&id='.$param['house_user_id'];
411 $this->wxsendmessage($openid,$send_data,config('option.template')['msg'],$url); 411 $this->wxsendmessage($openid,$send_data,config('option.template')['msg'],$url);
412 Db::commit(); 412 Db::commit();
413 } catch (PDOException $e) { 413 } catch (PDOException $e) {
@@ -262,7 +262,7 @@ class Store extends Api @@ -262,7 +262,7 @@ class Store extends Api
262 $result_invite = true; 262 $result_invite = true;
263 try{ 263 try{
264 $param['user_id'] = $this->auth->id; 264 $param['user_id'] = $this->auth->id;
265 - $param['house_ids'] = ','.$pay_data['house_ids'].','; 265 + $param['house_ids'] = ','.$param['house_ids'].',';
266 if(!empty($param['id'])) { 266 if(!empty($param['id'])) {
267 $result = $this->store_model->edit($param); 267 $result = $this->store_model->edit($param);
268 } else { 268 } else {
@@ -1240,7 +1240,7 @@ class Store extends Api @@ -1240,7 +1240,7 @@ class Store extends Api
1240 "remark" => '', 1240 "remark" => '',
1241 ); 1241 );
1242 $openid = Db::name('third')->where('user_id',$msg['user_id'])->value('openid'); 1242 $openid = Db::name('third')->where('user_id',$msg['user_id'])->value('openid');
1243 - $url = config('option.vue_url') . '/dianpuliuyan?id='.$msg['user_id']; 1243 + $url = config('option.vue_url') . '/dianpuliuyan?is_template=1&id='.$msg['user_id'];
1244 $this->wxsendmessage($openid,$send_data,config('option.template')['msg'],$url); 1244 $this->wxsendmessage($openid,$send_data,config('option.template')['msg'],$url);
1245 Db::commit(); 1245 Db::commit();
1246 } catch (PDOException $e) { 1246 } catch (PDOException $e) {
@@ -106,6 +106,7 @@ class User extends Api @@ -106,6 +106,7 @@ class User extends Api
106 "id_num": "100001", //ID 106 "id_num": "100001", //ID
107 "identity": 0, //身份0普通用户1主管理员2子管理员3商家 107 "identity": 0, //身份0普通用户1主管理员2子管理员3商家
108 "url": "/u/2", 108 "url": "/u/2",
  109 + "is_store": 1, //商家入驻状态1待支付2待审核3审核通过4审核驳回
109 "house": { //小区信息 110 "house": { //小区信息
110 "id": 17, //小区ID 111 "id": 17, //小区ID
111 "name": "碧海花园小区" //小区名称 112 "name": "碧海花园小区" //小区名称
@@ -135,7 +136,9 @@ class User extends Api @@ -135,7 +136,9 @@ class User extends Api
135 // 未读消息数量 136 // 未读消息数量
136 'message_num' => \app\api\model\Message::where('user_id',$user['id']) 137 'message_num' => \app\api\model\Message::where('user_id',$user['id'])
137 ->where('is_read_user',2) 138 ->where('is_read_user',2)
138 - ->count() 139 + ->count(),
  140 + // 是否入驻店铺
  141 + 'is_store' => \app\api\model\Store::where('id',$this->auth->id)->value('status')
139 ]; 142 ];
140 $user = $user->visible([ 143 $user = $user->visible([
141 'id', 144 'id',
@@ -398,4 +398,34 @@ if(!function_exists('array_sort')) { @@ -398,4 +398,34 @@ if(!function_exists('array_sort')) {
398 } 398 }
399 return $array; 399 return $array;
400 } 400 }
  401 +}
  402 +
  403 +if(!function_exists('tranTime')) {
  404 + function tranTime($time)
  405 + {
  406 + $rtime = date("m-d H:i", $time);
  407 + $htime = date("H:i", $time);
  408 + $time = time() - $time;
  409 + if ($time < 60) {
  410 + $str = '刚刚';
  411 + } elseif ($time < 60 * 60) {
  412 + $min = floor($time / 60);
  413 + $str = $min . '分钟前';
  414 + } elseif ($time < 60 * 60 * 24) {
  415 + $h = floor($time / (60 * 60));
  416 + $str = $h . '小时前 ' . $htime;
  417 + } else {
  418 + $str = floor($time / 86400) . '天前';
  419 + }
  420 +// elseif ($time < 60 * 60 * 24 * 3) {
  421 +// $d = floor($time / (60 * 60 * 24));
  422 +// if ($d == 1)
  423 +// $str = '昨天 ' . $rtime;
  424 +// else
  425 +// $str = '前天 ' . $rtime;
  426 +// } else {
  427 +// $str = $rtime;
  428 +// }
  429 + return $str;
  430 + }
401 } 431 }