96 lines
2.1 KiB
PHP
Raw Normal View History

2020-06-07 14:22:41 +08:00
<?php
/**
* @filename Users.php
* @date 2020/6/7
* @project https://github.com/yanwenwu/catch-admin
* @document http://doc.catchadmin.com
* @author JaguarJack <njphper@gmail.com>
* @copyright By CatchAdmin
* @license https://github.com/yanwenwu/catch-admin/blob/master/LICENSE.txt
*/
namespace catchAdmin\wechat\controller;
2020-06-21 10:48:55 +08:00
use catchAdmin\wechat\model\WechatUsers;
2020-06-07 14:22:41 +08:00
use catcher\base\CatchController;
use catcher\CatchResponse;
2020-06-19 19:29:21 +08:00
use catcher\Utils;
2020-06-07 14:22:41 +08:00
class Users extends CatchController
{
2020-06-19 19:29:21 +08:00
protected $user;
2020-06-21 10:48:55 +08:00
public function __construct(WechatUsers $users)
2020-06-07 14:22:41 +08:00
{
2020-06-21 10:48:55 +08:00
$this->user = $users;
2020-06-19 19:29:21 +08:00
}
/**
* 列表
*
* @time 2020年06月19日
* @return \think\response\Json
*/
2020-06-21 10:48:55 +08:00
public function index()
2020-06-19 19:29:21 +08:00
{
2020-06-21 10:48:55 +08:00
return CatchResponse::paginate($this->user->getList());
2020-06-19 19:29:21 +08:00
}
/**
* 备注
*
* @time 2020年06月19日
* @param $optionId
* @param $remark
* @return \think\response\Json
*/
public function remark($optionId, $remark)
{
return CatchResponse::success($this->user->remark($optionId, $remark));
}
/**
* 拉黑
*
* @time 2020年06月19日
* @param $openId
* @return \think\response\Json
*/
public function block($openId)
{
return CatchResponse::success($this->user->block(Utils::stringToArrayBy($openId)));
}
/**
* 拉黑列表
*
* @time 2020年06月19日
* @param null $nextOpenid
* @return \think\response\Json
*/
public function blacklist($nextOpenid = null)
{
return CatchResponse::success($this->user->blacklist($nextOpenid));
}
/**
* 取消拉黑
*
* @time 2020年06月19日
* @param $openId
* @return \think\response\Json
*/
public function unblock($openId)
{
return CatchResponse::success($this->user->unblock(Utils::stringToArrayBy($openId)));
2020-06-07 14:22:41 +08:00
}
2020-06-21 10:48:55 +08:00
public function subscribe()
{
}
public function unsubscribe()
{
}
2020-06-07 14:22:41 +08:00
}