为顾问分配客户

$obj = new \wechat\Wechat();
$obj->official()->customer()->guide_add_user('{
    "guide_account": "wx_account",
    "openid": "xxxxxxx",
    "buyer_nickname": "张三"
}');

成功结果:

true

或者:

array(2) {
  [0]=>
  array(3) {
    ["errcode"]=>
    int(0)
    ["errmsg"]=>
    string(2) "ok"
    ["openid"]=>
    string(7) "xxxxxxx"
  }
  [1]=>
  array(3) {
    ["errcode"]=>
    int(0)
    ["errmsg"]=>
    string(2) "ok"
    ["openid"]=>
    string(8) "yyyyyyyy"
  }
}

为顾问移除客户

$obj = new \wechat\Wechat();
$obj->official()->customer()->guide_delete_user('{
    "guide_account": "wx_account",
    "openid": "xxxxxxx"
}');

成功结果:

true

或者:

array(2) {
  [0]=>
  array(3) {
    ["errcode"]=>
    int(0)
    ["errmsg"]=>
    string(2) "ok"
    ["openid"]=>
    string(7) "xxxxxxx"
  }
  [1]=>
  array(3) {
    ["errcode"]=>
    int(0)
    ["errmsg"]=>
    string(2) "ok"
    ["openid"]=>
    string(8) "yyyyyyyy"
  }
}

获取顾问的客户列表

$obj = new \wechat\Wechat();
$obj->official()->customer()->guide_list_user([
    "guide_account" => "wx_account",
    "page" => 0,
    "num" => 10
]);

成功结果:

array(2) {
  ["total_num"]=>
  int(1)
  ["list"]=>
  array(1) {
    [0]=>
    array(3) {
      ["openid"]=>
      string(7) "xxxxxxx"
      ["buyer_nickname"]=>
      string(7) "xxxxxxx"
      ["create_time"]=>
      int(11223344)
    }
  }
}

为客户更换顾问

$obj = new \wechat\Wechat();
$obj->official()->customer()->user_update_guide('{
    "old_guide_account": "wx_account",
    "new_guide_account": "wx_account",
    "openid": "xxxxxxx"
}');

成功结果:

true

或者:

array(2) {
  [0]=>
  array(3) {
    ["errcode"]=>
    int(0)
    ["errmsg"]=>
    string(2) "ok"
    ["openid"]=>
    string(7) "xxxxxxx"
  }
  [1]=>
  array(3) {
    ["errcode"]=>
    int(0)
    ["errmsg"]=>
    string(2) "ok"
    ["openid"]=>
    string(8) "yyyyyyyy"
  }
}

修改客户昵称

$obj = new \wechat\Wechat();
// false.失败  true.成功
$obj->official()->customer()->user_select_guide('{
    "guide_account": "wx_account",
    "openid": "xxxxxx",
    "buyer_nickname": "张三"
}');

查询客户所属顾问

$obj = new \wechat\Wechat();
// false.失败  true.成功
$obj->official()->customer()->user_update_nick('{
    "openid": "xxxxxxx"
}');

成功结果:

array(5) {
  ["openid"]=>
  string(5) "xxxxx"
  ["guide_account"]=>
  string(5) "xxxxx"
  ["guide_openid"]=>
  string(5) "xxxxx"
  ["buyer_nickname"]=>
  string(6) "张三"
  ["create_time"]=>
  int(11223344)
}

查询指定顾问和客户的关系

$obj = new \wechat\Wechat();
// false.失败  true.成功
$obj->official()->customer()->user_join_guide('{
	"guide_account": "wx_account",
    "openid": "xxxxxxx"
}');

成功结果:

array(3) {
  ["openid"]=>
  string(5) "xxxxx"
  ["buyer_nickname"]=>
  string(6) "张三"
  ["create_time"]=>
  int(11223344)
}

SW-X

企业级 - 高性能 PHP 框架

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

本篇目录