...
|
...
|
@@ -484,11 +484,6 @@ class ProductController extends RestBaseController |
|
|
if ($check) {
|
|
|
$this->error(['code'=>'40006','msg'=>'该产品您已申请']);
|
|
|
}
|
|
|
//添加该名片的被浏览记录 产品 入口
|
|
|
$is_exist = Db::name('browse_log')
|
|
|
->where(['topic_id' => $data['id'],'user_id' => $this->userId])
|
|
|
->field('id')
|
|
|
->find();
|
|
|
$cardID = Db::name('product')
|
|
|
->alias('p')
|
|
|
->join('card c','p.user_id =c.user_id')
|
...
|
...
|
@@ -497,6 +492,18 @@ class ProductController extends RestBaseController |
|
|
if (!$cardID) {
|
|
|
$this->error(['code'=>'40011','msg'=>'该产品不存在']);
|
|
|
}
|
|
|
//排除业务员自己 不能申请自己产品
|
|
|
if ($this->userType == 3) {
|
|
|
$card_id = Db::name('card')->where(['user_id' => $this->userId])->value('id');
|
|
|
if ($cardID == $card_id) {
|
|
|
$this->error(['code'=>'40014','msg'=>'不能申请自己的产品']);
|
|
|
}
|
|
|
}
|
|
|
//添加该名片的被浏览记录 产品 入口
|
|
|
$is_exist = Db::name('browse_log')
|
|
|
->where(['topic_id' => $data['id'],'user_id' => $this->userId,'type' =>2])
|
|
|
->field('id')
|
|
|
->find();
|
|
|
if (!$is_exist) {
|
|
|
Db::name('browse_log')->insert(['topic_id' => $cardID,'user_id' => $this->userId,'type'=>2]);
|
|
|
}
|
...
|
...
|
|