添加顾问

$obj = new \wechat\Wechat();
// false.失败 true.成功
$obj->official()->guideacct()->create('{
    "guide_account": "wx_account",
    "guide_nickname": "张三"
}');

获取顾问信息

$obj = new \wechat\Wechat();
$obj->official()->guideacct()->get([
    'guide_account' => '张三'
]);

成功结果:

array(4) {
  ["guide_account"]=>
  string(6) "张三"
  ["guide_headimgurl"]=>
  string(7) "xxxxxxx"
  ["guide_nickname"]=>
  string(7) "xxxxxxx"
  ["guide_openid"]=>
  int(0)
}

修改顾问信息

$obj = new \wechat\Wechat();
// false.失败 true.成功
$obj->official()->guideacct()->update('{
    "guide_account": "wx_account",
    "guide_nickname": "张三"
}');

删除顾问

$obj = new \wechat\Wechat();
// false.失败 true.成功
$obj->official()->guideacct()->delete([
    'guide_account' => '张三'
]);

获取服务号顾问列表

$obj = new \wechat\Wechat();
$obj->official()->guideacct()->showlist([
    'page' => 0,
    'num' => 10,
]);

成功结果:

array(2) {
  ["total_num"]=>
  int(1)
  ["list"]=>
  array(1) {
    [0]=>
    array(4) {
      ["guide_account"]=>
      string(6) "张三"
      ["guide_openid"]=>
      string(7) "xxxxxxx"
      ["guide_headimgurl"]=>
      string(7) "xxxxxxx"
      ["guide_nickname"]=>
      string(7) "xxxxxxx"
    }
  }
}

生成顾问二维码

$obj = new \wechat\Wechat();
$obj->official()->guideacct()->qrcode([
   "guide_account" => "wx_account"
]);

成功结果:

二维码的URL地址

获取顾问聊天记录

$obj = new \wechat\Wechat();
$obj->official()->guideacct()->chat_record('{
    "guide_account": "张三",
    "openid": "xxxx",
    "begin_time": 121212,
    "end_time": 232323,
    "page": 0,
    "num": 10
}');

成功结果:

array(2) {
  ["total_num"]=>
  int(1)
  ["msg_list"]=>
  array(1) {
    [0]=>
    array(6) {
      ["guide_account"]=>
      string(6) "张三"
      ["openid"]=>
      string(3) "xxx"
      ["create_time"]=>
      int(121212)
      ["content"]=>
      string(4) "test"
      ["content_type"]=>
      int(1)
      ["direction"]=>
      int(1)
    }
 }

设置快捷回复与关注自动回复

$obj = new \wechat\Wechat();
// false.失败 true.成功
$obj->official()->guideacct()->set_config('{
    "guide_account": "xxxxxxx",
    "is_delete": false,
    "guide_fast_reply_list": [
        {"content": "快捷回复"}
    ]
  }');

获取快捷回复与关注自动回复

$obj = new \wechat\Wechat();
$obj->official()->guideacct()->get_config([
    "guide_account" => "张三"
]);

成功结果:

array(3) {
  ["guide_fast_reply_list"]=>
  array(1) {
    [0]=>
    array(2) {
      ["content"]=>
      string(12) "快捷回复"
      ["updatetime"]=>
      int(11111)
    }
  }
  ["errcode"]=>
  int(0)
  ["errmsg"]=>
  string(2) "ok"
}

设置敏感词与离线自动回复

$obj = new \wechat\Wechat();
// false.失败 true.成功
$obj->official()->guideacct()->set_word('{
    "is_delete": false,
    "black_keyword": {
      "values": [
        "敏感词1",
        "敏感词2"
      ]
    },
    "guide_auto_reply": {
      "content": "自动回复"
    }
}');

获取敏感词与离线自动回复

$obj = new \wechat\Wechat();
$obj->official()->guideacct()->get_word();

成功结果:

array(4) {
  ["errcode"]=>
  int(0)
  ["errmsg"]=>
  string(2) "ok"
  ["black_keyword"]=>
  array(2) {
    ["values"]=>
    array(2) {
      [0]=>
      string(10) "敏感词1"
      [1]=>
      string(10) "敏感词2"
    }
    ["updatetime"]=>
    int(11111)
  }
  ["guide_auto_reply"]=>
  array(1) {
    ["content"]=>
    string(12) "自动回复"
  }
}

允许微信用户复制小程序页面路径

$obj = new \wechat\Wechat();
// false.失败 true.成功
$obj->official()->guideacct()->copy_path([
    "wxa_appid" => "xxxxxxx",
    "wxa_username" => "xxxxxxx"
]);

新建顾问分组

$obj = new \wechat\Wechat();
// false.失败 true.成功
$obj->official()->guideacct()->group_create([
    "group_name" => "test"
]);

获取服务号下所有顾问分组的列表

$obj = new \wechat\Wechat();
$obj->official()->guideacct()->group_list();

成功结果:

array(2) {
  [0]=>
  array(4) {
    ["id"]=>
    int(3223)
    ["name"]=>
    string(5) "xxxxx"
    ["create_time"]=>
    int(232)
    ["update_time"]=>
    int(2323)
  }
  [1]=>
  array(4) {
    ["id"]=>
    int(1312)
    ["name"]=>
    string(5) "ewrwe"
    ["create_time"]=>
    int(3243)
    ["update_time"]=>
    int(2323)
  }
}

获取顾问分组信息

$obj = new \wechat\Wechat();
$obj->official()->guideacct()->group_page([
    "group_id" => "1212",
    "page" => 0,
    "num" => 100
]);

成功结果:

array(2) {
  ["guide_list"]=>
  array(1) {
    [0]=>
    array(5) {
      ["guide_account"]=>
      string(5) "xxxxx"
      ["guide_headimgurl"]=>
      string(6) "xxxxxx"
      ["guide_nickname"]=>
      string(3) "xxx"
      ["create_time"]=>
      int(1584090536)
      ["guide_openid"]=>
      string(0) ""
    }
  }
  ["total_num"]=>
  int(1)
}

分组内添加顾问

$obj = new \wechat\Wechat();
// false.失败 true.成功
$obj->official()->guideacct()->group_add_guide([
    "group_id" => "121",
 	"guide_account" => "xxx"
]);

分组内删除顾问

$obj = new \wechat\Wechat();
// false.失败 true.成功
$obj->official()->guideacct()->group_delete_guide([
    "group_id" => "121",
 	"guide_account" => "xxx"
]);

获取顾问所在分组

$obj = new \wechat\Wechat();
$obj->official()->guideacct()->guide_select_group([
 	"guide_account" => "xxx"
]);

成功结果:

array(2) {
  [0]=>
  int(12736)
  [1]=>
  int(12238)
}

删除顾问分组

$obj = new \wechat\Wechat();
// false.失败 true.成功
$obj->official()->guideacct()->group_delete([
    "group_id" => "121"
]);

SW-X

企业级 - 高性能 PHP 框架

最后更新:3年前 . 作者-小黄牛

本篇目录