初始化代码
This commit is contained in:
82
app/im/info/Subscribe.php
Normal file
82
app/im/info/Subscribe.php
Normal file
@@ -0,0 +1,82 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | Longbing [ WE CAN DO IT JUST THINK IT ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright Chengdu longbing Technology Co., Ltd.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Website http://longbing.org/
|
||||
// +----------------------------------------------------------------------
|
||||
// | Sales manager: +86-13558882532 / +86-13330887474
|
||||
// | Technical support: +86-15680635005
|
||||
// | After-sale service: +86-17361005938
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\im\info;
|
||||
|
||||
use app\card\model\CardCount;
|
||||
use app\radar\model\RadarMessage;
|
||||
use app\radar\model\RadarOrder;
|
||||
use longbingcore\diy\BaseSubscribe;
|
||||
|
||||
/**
|
||||
* @author shuixian
|
||||
* @DataTime: 2019/12/11 16:23
|
||||
* Class Subscribe
|
||||
* @package app\ucenter\info
|
||||
*/
|
||||
class Subscribe extends BaseSubscribe
|
||||
{
|
||||
/**
|
||||
* 相应个人中心工具菜单
|
||||
*
|
||||
* @return mixed
|
||||
* @author shuixian
|
||||
* @DataTime: 2019/12/12 11:24
|
||||
*/
|
||||
public function onAddWorkStaffCenterMenu(){
|
||||
$toolsMenu= [
|
||||
|
||||
"title" => '话术库管理',
|
||||
"icon" => 'iconhuashuku',
|
||||
"link" => '/admin/pages/speech/index',
|
||||
"linkType"=> '4',
|
||||
|
||||
];
|
||||
|
||||
return [$toolsMenu];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 员工 客户获取列表查询
|
||||
*
|
||||
* @param $data
|
||||
* @return array
|
||||
* @author shuixian
|
||||
* @DataTime: 2019/12/26 10:30
|
||||
*/
|
||||
public function onStaffCustomerList($data)
|
||||
{
|
||||
// 聊天数量
|
||||
$map1 = [ [ 'user_id', '=', $data[ 'uid' ] ], [ 'target_id', '=', $data['to_uid'] ] ];
|
||||
$map2 = [ [ 'target_id', '=', $data[ 'uid' ] ], [ 'user_id', '=', $data['to_uid'] ] ];
|
||||
$messageCount = RadarMessage::whereOr( [ $map1, $map2 ] )->count();
|
||||
|
||||
$msgData[ 'count' ] = $messageCount;
|
||||
$msgData[ 'title' ] = "聊天";
|
||||
|
||||
// 通话数量
|
||||
$phoneCount = CardCount::where( [ [ 'user_id', '=', $data[ 'uid' ] ], [ 'to_uid', '=', $data['to_uid'] ],
|
||||
[ 'sign', '=', 'copy' ], [ 'type', 'in', [ 2, 3, 11 ] ] ]
|
||||
)->count();
|
||||
|
||||
|
||||
$phoneData[ 'count' ] = $phoneCount;
|
||||
$phoneData[ 'title' ] = "通话";
|
||||
|
||||
return [$msgData , $phoneData];
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user