45 lines
1010 B
PHP
45 lines
1010 B
PHP
![]() |
<?php
|
||
|
|
||
|
namespace app\robot\service;
|
||
|
|
||
|
use app\channel\service\CardGroupService;
|
||
|
use app\channel\service\ChannelService;
|
||
|
use app\core\Service;
|
||
|
use app\gateway\service\AuthService;
|
||
|
use app\merchant\service\CardService as MerchantCardService;
|
||
|
|
||
|
//use app\merchant\service\MerchantRelationService;
|
||
|
|
||
|
/**
|
||
|
* 微信
|
||
|
* Class ChannelService
|
||
|
* @package app\channel\service
|
||
|
*/
|
||
|
class WeChatService extends Service
|
||
|
{
|
||
|
/**
|
||
|
* 设置默认操作表
|
||
|
* @var string
|
||
|
*/
|
||
|
public $table="robot_wechat";
|
||
|
public function db($table = false)
|
||
|
{
|
||
|
$table = $table ? $table : $this->table;
|
||
|
$this->db = $this->app->db->name($table);
|
||
|
return $this->db;
|
||
|
}
|
||
|
|
||
|
# 获取机器人信息
|
||
|
public function getInfo($token)
|
||
|
{
|
||
|
if (is_numeric($token)) {
|
||
|
$where['id'] = $token;
|
||
|
} else {
|
||
|
$where['token'] = $token;
|
||
|
}
|
||
|
|
||
|
//$where['status'] = 1;
|
||
|
$where['is_deleted'] = 0;
|
||
|
return $this->db()->where($where)->find();
|
||
|
}
|
||
|
}
|