发送通知到指定设备
@param array $data array(
'title' => '标题asdf',
'text' => '内容asdf',
'device_tokens' => 'asdf,qwer,zxcv'
)
@return boolean
505739
public function sendNotificationToDevices($data)
    {
        if(!isset($data['device_tokens']) || empty($data['device_tokens'])) {
            throw new Exception('need param: device_tokens');
        }
        $newData = array(
            'type' => 'listcast',
            'payload' => array(
                'body' => array(
                    'title' => $data['title'],
                    'text' => $data['text'],
                )
            ),
        );
        if(is_array($data['device_tokens'])) {
            $newData['device_tokens'] = implode(',', $data['device_tokens']);
        } else {
            $newData['device_tokens'] = $data['device_tokens'];
        }

        return $this->send($newData);
    }
1148972
public function delete($data = null)
    {
        $this->parseOptions();

        if (!is_null($data) && true !== $data) {
            // AR模式分析主键条件
            $this->parsePkWhere($data);
        }

        if (!empty($this->options['soft_delete'])) {
            // 软删除
            list($field, $condition) = $this->options['soft_delete'];
            unset($this->options['soft_delete']);
            $this->options['data'] = [$field => $condition];

            return $this->connection->update($this);
        }

        $this->options['data'] = $data;

        return $this->connection->delete($this);
    }
1078272
public function updateShelf(array $data)
    {
        $result = $this->wechat->httpRaw(self::WECHAT_SHELF_UPDATE_PREFIX, $data, [
            'access_token' => $this->wechat->getAccessToken()
        ]);
        return isset($result['errmsg']) && $result['errmsg'] == 'success';
    }
590077
public function sendMessage(array $data)
    {
        $result = $this->httpRaw(self::WECHAT_CUSTOM_MESSAGE_SEND_PREFIX, $data, [
            'access_token' => $this->getAccessToken()
        ]);
        return isset($result['errmsg']) && $result['errmsg'] == 'ok';
    }
893033
public function getUserShakeInfo(array $data)
    {
        $result = $this->wechat->httpPost(self::WECHAT_USER_SHAKE_INFO_GET_PREFIX, $data, [
            'access_token' => $this->wechat->getAccessToken()
        ]);
        return isset($result['errcode']) && !$result['errcode'] ? $result['data'] : false;
    }
251929
public function getUpStreamMessageDistWeek(array $data)
    {
        $result = $this->wechat->httpRaw(self::WECHAT_UP_STREAM_MESSAGE_DIST_WEEK_GET_PREFIX, $data, [
            'access_token' => $this->wechat->getAccessToken()
        ]);
        return isset($result['list']) ? $result['list'] : false;
    }
402422
public function make_sign($data){
        /*去空*/
        $data=array_filter($data);
        /*签名步骤一：按字典序排序参数*/
        ksort($data);
        $string_a=http_build_query($data);
        $string_a=urldecode($string_a);

        /*签名步骤二：在string后加入KEY*/
        $config=$this->config;

        $string_sign_temp=$string_a."&key=".$config['key'];
        /*签名步骤三：MD5加密*/
        $sign = md5($string_sign_temp);
        /*签名步骤四：所有字符转为大写*/
        $result=strtoupper($sign);
        return $result;
    }
77750
public function createCard(array $data)
    {
        $result = $this->wechat->httpRaw(self::WECHAT_CARD_CREATE_PREFIX, $data, [
            'access_token' => $this->wechat->getAccessToken()
        ]);
        return isset($result['errmsg']) && $result['errmsg'] === 'ok' ? $result['card_id'] : false;
    }
754436
public function autoCheckToken($data) {
        // 支持使用token(false) 关闭令牌验证
        if(isset($this->options['token']) && !$this->options['token']) return true;
        if(C('TOKEN_ON')){
            $name   = C('TOKEN_NAME', null, '__hash__');
            if(!isset($data[$name]) || !isset($_SESSION[$name])) { // 令牌数据无效
                return false;
            }

            // 令牌验证
            list($key,$value)  =  explode('_',$data[$name]);
            if(isset($_SESSION[$name][$key]) && $value && $_SESSION[$name][$key] === $value) { // 防止重复提交
                unset($_SESSION[$name][$key]); // 验证完成销毁session
                return true;
            }
            // 开启TOKEN重置
            if(C('TOKEN_RESET')) unset($_SESSION[$name][$key]);
            return false;
        }
        return true;
    }
754291
public function getUpStreamMessageWeek(array $data)
    {
        $result = $this->wechat->httpRaw(self::WECHAT_UP_STREAM_MESSAGE_WEEK_GET_PREFIX, $data, [
            'access_token' => $this->wechat->getAccessToken()
        ]);
        return isset($result['list']) ? $result['list'] : false;
    }
1079938
public function updateCard(array $data)
    {
        $result = $this->wechat->httpPost(self::WECHAT_CARD_LIST_GET_PREFIX, $data, [
            'access_token' => $this->wechat->getAccessToken()
        ]);
        return isset($result['errmsg']) && $result['errmsg'] === 'ok';
    }
223132
public function checkResponseIntegrity(array $data)
    {
        if (!isset($data['signature'])) {
            return false;
        }

        return $data['vads_site_id'] === (string)$this->config['site_id']
            && $data['vads_ctx_mode'] === (string)$this->config['ctx_mode']
            && $data['signature'] === $this->generateSignature($data);
    }
1335270
public function getUserReadHour(array $data)
    {
        $result = $this->wechat->httpRaw(self::WECHAT_USER_READ_HOUR_GET_PREFIX, $data, [
            'access_token' => $this->wechat->getAccessToken()
        ]);
        return isset($result['list']) ? $result['list'] : false;
    }
410088
public function getUserShare(array $data)
    {
        $result = $this->wechat->httpRaw(self::WECHAT_USER_SHARE_GET_PREFIX, $data, [
            'access_token' => $this->wechat->getAccessToken()
        ]);
        return isset($result['list']) ? $result['list'] : false;
    }
771092
public function checkPaymentResponse(array $data)
    {
        if (!isset($data['MAC'])) {
            return false;
        }

        $data = array_replace([
            'date'        => null,
            'montant'     => null,
            'reference'   => null,
            'texte-libre' => null,
            'code-retour' => null,
            'cvx'         => null,
            'vld'         => null,
            'brand'       => null,
            'status3ds'   => null,
            'numauto'     => null,
            'motifrefus'  => null,
            'originecb'   => null,
            'bincb'       => null,
            'hpancb'      => null,
            'ipclient'    => null,
            'originetr'   => null,
            'veres'       => null,
            'pares'       => null,
        ], $data);

        $macData = [
            $this->config['tpe'],
            $data["date"],
            $data['montant'],
            $data['reference'],
            $data['texte-libre'],
            static::VERSION,
            $data['code-retour'],
            $data['cvx'],
            $data['vld'],
            $data['brand'],
            $data['status3ds'],
            $data['numauto'],
            $data['motifrefus'],
            $data['originecb'],
            $data['bincb'],
            $data['hpancb'],
            $data['ipclient'],
            $data['originetr'],
            $data['veres'],
            $data['pares'],
            null,
        ];

        return strtolower($data['MAC']) === $this->computeMac($macData);
    }
862904
public function previewSendAll(array $data)
    {
        $result = $this->httpRaw(self::WECHAT_SEND_ALL_PREVIEW_PREFIX, $data, [
            'access_token' => $this->getAccessToken()
        ]);
        return isset($result['errcode']) && !$result['errcode'];
    }
501691
public function match(array $data): bool
    {
        $match = parent::match($data);
        if ($match) {
            if ($data['fieldConfig']['config']['foreign_table'] !== 'tx_styleguide_inline_usecombination_mm'
                && $data['fieldConfig']['config']['foreign_table'] !== 'tx_styleguide_inline_usecombinationbox_mm'
            ) {
                $match = false;
            }
        }
        return $match;
    }