>[info] [客服消息](https://www.easywechat.com/4.x/official-account/messages.html)推送:文档中写明了用户48小时与公众号没有互动,便不能收到客服消息,所以如果公众号活跃程度不够,不建议接入。
##### 温馨提示:当前项目对[客服消息](https://www.easywechat.com/4.x/official-account/messages.html)也做了相关接入操作,代码如下所示
~~~
/**
* 客服消息
* /api/Easycenter/Orderput
*/
public function Orderput()
{
//获取数据库中目标用户的openid
$userlist = \app\admin\model\User::where(['status' => 'normal'])->column("openid");
$app = $this->app;
$msg = "大家好!欢迎使用\n 老吴线报系统。";
if (count($userlist) == 1) {
//单发
$message = new Text($msg);
$result = $app->customer_service->message($message)->to($userlist[0])->send();
} else {
//群发
$app->broadcasting->sendText($msg, $userlist);
}
}
~~~