增加钉钉消息推送

Signed-off-by: vilson <545522390@qq.com>
This commit is contained in:
vilson 2019-06-24 21:33:41 +08:00
parent 723e3ad25d
commit e25954306e

View File

@ -9,7 +9,6 @@
namespace app\index\controller;
use app\common\Model\Client;
use app\common\Model\Member;
use controller\BasicApi;
use EasyDingTalk\Application;
@ -23,27 +22,6 @@ class Oauth extends BasicApi
public function index()
{
$app = new Application(config('dingtalk.'));
$msg = [
'msgtype' => "oa",
'oa' => [
'message_url' => 'http://dingtalk.com',
'head' => ['bgcolor' => 'FFBBBBBB', 'title' => '消息通知'],
'body' => ['title' => '888', 'content' => '666'],
]
];
$params = [
'agent_id'=> '271863764',
'userid_list' => 'manager9168',
'msg'=> json_encode($msg)
];
$res = $app->conversation->sendCorporationMessage($params);
echo json_encode($res);die;
$userId = $app->user->getUseridByUnionid('3CnKFHEE7mX1hayPIHvpCwiEiE');
// echo json_encode($userId);die;
$userId = $userId['userid'];
$user = $app->user->get($userId, $lang = null);
echo json_encode($user);die;
}
public function dingTalkOauth()