public function ddMsg($content, $atMobiles = [], $isAtAll = false, $webhook = '')
$atMobiles = is_array($atMobiles) ? $atMobiles : [$atMobiles];
(!is_string($content) || !is_numeric($content)) && $content = var_export($content, TRUE);
'text' => ['content' => $content],
'atMobiles' => $atMobiles,
$data_string = json_encode($data);
$dd_access_token = config('myapp.dd_access_token');
$webhook = !empty($webhook) ? $webhook:"https://oapi.dingtalk.com/robot/send?access_token={$dd_access_token}";
curl_setopt($ch, CURLOPT_URL, $webhook);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json;charset=utf-8'));
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
$data = json_decode($data, true);
if (isset($data['errmsg']) && $data['errmsg'] == 'ok' && isset($data['errcode']) && $data['errcode'] == 0) {
