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

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

... ... @@ -136,6 +136,8 @@ class Hot extends Api
$list = $inform->items();
$view_model = new StoreInformView();
foreach ($list as &$v) {
// 发布时间调整
$v['createtime'] = tranTime(strtotime($v['createtime']));
// 获取点赞数及是否点赞
$where_g = [
'object_id' => $v['id']
... ... @@ -494,7 +496,7 @@ class Hot extends Api
"remark" => '',
);
$openid = Db::name('third')->where('user_id',$store['user_id'])->value('openid');
$url = config('option.vue_url') . '/messageto?id='.$msg_id;
$url = config('option.vue_url') . '/messageto?is_template=1&id='.$msg_id;
$this->wxsendmessage($openid,$send_data,config('option.template')['msg'],$url);
Db::commit();
} catch (PDOException $e) {
... ...
... ... @@ -791,7 +791,7 @@ class HouseAdmin extends Api
"remark" => '',
);
$openid = Db::name('third')->where('user_id',$msg['user_id'])->value('openid');
$url = config('option.vue_url') . '/messagelk?house_id='.$msg['object_id'].'&user_id='.$msg['object_user_id'];
$url = config('option.vue_url') . '/messagelk?is_template=1&house_id='.$msg['object_id'].'&user_id='.$msg['object_user_id'];
$this->wxsendmessage($openid,$send_data,config('option.template')['msg'],$url);
Db::commit();
} catch (PDOException $e) {
... ...
... ... @@ -407,7 +407,7 @@ class HouseBoard extends Api
"remark" => '',
);
$openid = Db::name('third')->where('user_id',$param['house_user_id'])->value('openid');
$url = config('option.vue_url') . '/liuyanxiaoxi?id='.$param['house_user_id'];
$url = config('option.vue_url') . '/liuyanxiaoxi?is_template=1&id='.$param['house_user_id'];
$this->wxsendmessage($openid,$send_data,config('option.template')['msg'],$url);
Db::commit();
} catch (PDOException $e) {
... ...
... ... @@ -262,7 +262,7 @@ class Store extends Api
$result_invite = true;
try{
$param['user_id'] = $this->auth->id;
$param['house_ids'] = ','.$pay_data['house_ids'].',';
$param['house_ids'] = ','.$param['house_ids'].',';
if(!empty($param['id'])) {
$result = $this->store_model->edit($param);
} else {
... ... @@ -1240,7 +1240,7 @@ class Store extends Api
"remark" => '',
);
$openid = Db::name('third')->where('user_id',$msg['user_id'])->value('openid');
$url = config('option.vue_url') . '/dianpuliuyan?id='.$msg['user_id'];
$url = config('option.vue_url') . '/dianpuliuyan?is_template=1&id='.$msg['user_id'];
$this->wxsendmessage($openid,$send_data,config('option.template')['msg'],$url);
Db::commit();
} catch (PDOException $e) {
... ...
... ... @@ -106,6 +106,7 @@ class User extends Api
"id_num": "100001", //ID
"identity": 0, //身份0普通用户1主管理员2子管理员3商家
"url": "/u/2",
"is_store": 1, //商家入驻状态1待支付2待审核3审核通过4审核驳回
"house": { //小区信息
"id": 17, //小区ID
"name": "碧海花园小区" //小区名称
... ... @@ -135,7 +136,9 @@ class User extends Api
// 未读消息数量
'message_num' => \app\api\model\Message::where('user_id',$user['id'])
->where('is_read_user',2)
->count()
->count(),
// 是否入驻店铺
'is_store' => \app\api\model\Store::where('id',$this->auth->id)->value('status')
];
$user = $user->visible([
'id',
... ...
... ... @@ -398,4 +398,34 @@ if(!function_exists('array_sort')) {
}
return $array;
}
}
if(!function_exists('tranTime')) {
function tranTime($time)
{
$rtime = date("m-d H:i", $time);
$htime = date("H:i", $time);
$time = time() - $time;
if ($time < 60) {
$str = '刚刚';
} elseif ($time < 60 * 60) {
$min = floor($time / 60);
$str = $min . '分钟前';
} elseif ($time < 60 * 60 * 24) {
$h = floor($time / (60 * 60));
$str = $h . '小时前 ' . $htime;
} else {
$str = floor($time / 86400) . '天前';
}
// elseif ($time < 60 * 60 * 24 * 3) {
// $d = floor($time / (60 * 60 * 24));
// if ($d == 1)
// $str = '昨天 ' . $rtime;
// else
// $str = '前天 ' . $rtime;
// } else {
// $str = $rtime;
// }
return $str;
}
}
\ No newline at end of file
... ...