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

名片详情测试2

@@ -141,7 +141,9 @@ class CardController extends RestBaseController @@ -141,7 +141,9 @@ class CardController extends RestBaseController
141 ->join('user u','c.user_id=u.id') 141 ->join('user u','c.user_id=u.id')
142 ->where(['c.id' => $data['id']]) 142 ->where(['c.id' => $data['id']])
143 ->field('c.id,c.user_id,c.name,c.position,c.tel,c.home_tel,c.email,c.wechat,c.company,u.avatar,c.address,c.description,c.pics,c.browse_num,c.like_num') 143 ->field('c.id,c.user_id,c.name,c.position,c.tel,c.home_tel,c.email,c.wechat,c.company,u.avatar,c.address,c.description,c.pics,c.browse_num,c.like_num')
  144 + ->fetchSql()
144 ->find(); 145 ->find();
  146 + $this->success('获取成功',$result);
145 //校验该用户是否 已对此名片点赞 147 //校验该用户是否 已对此名片点赞
146 $check = Db::name('like_log')->where(['user_id' => $this->userId,'topic_id' => $data['id']])->field('id')->find(); 148 $check = Db::name('like_log')->where(['user_id' => $this->userId,'topic_id' => $data['id']])->field('id')->find();
147 if ($check) { 149 if ($check) {
@@ -149,7 +151,7 @@ class CardController extends RestBaseController @@ -149,7 +151,7 @@ class CardController extends RestBaseController
149 } else { 151 } else {
150 $result['is_like'] = 0; 152 $result['is_like'] = 0;
151 } 153 }
152 - $this->success('获取成功',$result); 154 +
153 //添加该名片的被浏览记录 名片入口 155 //添加该名片的被浏览记录 名片入口
154 Db::startTrans(); 156 Db::startTrans();
155 $is_exist = Db::name('browse_log') 157 $is_exist = Db::name('browse_log')