REAPI/app/robot/service/WeChatService.php

45 lines
1010 B
PHP
Raw Permalink Normal View History

2024-12-04 12:33:47 +08:00
<?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();
}
}