删除门店
@param $poiId
@return bool
@throws \yii\web\HttpException
962766
public function deletePoi($poiId)
    {
        $result = $this->wechat->httpRaw(self::WECHAT_POI_GET_PREFIX, [
            'poi_id' => $poiId
        ], [
            'access_token' => $this->wechat->getAccessToken()
        ]);
        return isset($result['errmsg']) && $result['errmsg'] === 'ok';
    }
1173926
protected function initialize()
    {
        // Point类型支持
        Query::extend('point', function ($query, $field, $value = null, $fun = 'GeomFromText', $type = 'POINT') {
            if (!is_null($value)) {
                $query->data($field, ['point', $value, $fun, $type]);
            } else {
                if (is_string($field)) {
                    $field = explode(',', $field);
                }
                $query->setOption('point', $field);
            }

            return $query;
        });
    }
810739
public function bindThirdPoi(array $deviceIdentifier, int $poiId, string $appId)
    {
        $params = [
            'device_identifier' => $deviceIdentifier,
            'poi_id' => $poiId,
            'type' => 2,
            'poi_appid' => $appId,
        ];

        return $this->httpPostJson('shakearound/device/bindlocation', $params);
    }
1016162
public function actionFrontend ($id)
		{
			$page = Page::find()->where([ 'guid' => $id ])->one();

			if ($page === null)
			{
				throw new \yii\web\HttpException(404);
			}
			$this->setTitle($page->title);
			$this->data('page', $page);
			$this->_tpl = '@pageViews/page';
		}
453712
public function run()
    {
        if (yii::$app->getRequest()->getIsPost()) {//只允许post删除
            $id = yii::$app->getRequest()->get($this->paramSign, null);
            $param = yii::$app->getRequest()->post($this->paramSign, null);
            if($param !== null){
                $id = $param;
            }

            if( yii::$app->getRequest()->getIsAjax() ){
                yii::$app->getResponse()->format = $this->ajaxResponseFormat;
            }
            if (! $id) {
                throw new BadRequestHttpException(yii::t('app', "Id doesn't exit"));
            }
            if(is_array($id)){
                $ids = $id;
            }else{
                $ids = explode(',', $id);
            }

            $errorIds = [];
            /* @var $model yii\db\ActiveRecord */
            $model = null;
            foreach ($ids as $one) {
                $model = call_user_func([$this->modelClass, 'findOne'], $one);
                if ($model) {
                    $model->setScenario($this->scenario);
                    if (! $result = $model->delete()) {
                        $errorIds[] = $one;
                    }
                }
            }
            if (count($errorIds) == 0) {
                if( !yii::$app->getRequest()->getIsAjax() ) return $this->controller->redirect(yii::$app->getRequest()->headers['referer']);
                return ['status'=>true,'msg'=>yii::t('app','Success')];
            } else {
                $errors = $model->getErrors();
                $err = '';
                foreach ($errors as $v) {
                    $err .= $v[0];
                }
                if ($err != '') {
                    $err = '.' . $err;
                }
                throw new UnprocessableEntityHttpException('id ' . implode(',', $errorIds) . $err);
            }
        } else {
            throw new MethodNotAllowedHttpException(yii::t('app', "Delete must be POST http method"));
        }
    }
954977
public function chown($uid, $gid = -1, $cb = null, $pri = EIO_PRI_DEFAULT)
    {
        $cb = CallbackWrapper::forceWrap($cb);
        if (!$this->fd) {
            if ($cb) {
                $cb($this, false);
            }
            return false;
        }
        if (!FileSystem::$supported) {
            $r = chown($this->path, $uid);
            if ($gid !== -1) {
                $r = $r && chgrp($this->path, $gid);
            }
            if ($cb) {
                $cb($this, $r);
            }
            return false;
        }
        return eio_fchown($this->fd, $uid, $gid, $pri, $cb, $this);
    }
1049456
public function init() {
        //close csrf
        Yii::$app->request->enableCsrfValidation = false;
        //默认设置

       // $this->php_path =  dirname(__FILE__) . '/';
        $this->php_path =  $_SERVER['DOCUMENT_ROOT'] . '/';
        $this->php_url =  '/';
//根目录路径，可以指定绝对路径，比如 /var/www/attached/
        $this->root_path = $this->php_path . 'upload/';
//根目录URL，可以指定绝对路径，比如 http://www.yoursite.com/attached/
        $this->root_url = $this->php_url . 'upload/';
//图片扩展名
//            $ext_arr = ['gif', 'jpg', 'jpeg', 'png', 'bmp'],
//文件保存目录路径
        $this->save_path = $this->php_path . 'upload/';
//文件保存目录URL
        $this->save_url = $this->php_url . 'upload/';
//定义允许上传的文件扩展名
//            $ext_arr = array(
//                'image' => array('gif', 'jpg', 'jpeg', 'png', 'bmp'),
//                'flash' => array('swf', 'flv'),
//                'media' => array('swf', 'flv', 'mp3', 'wav', 'wma', 'wmv', 'mid', 'avi', 'mpg', 'asf', 'rm', 'rmvb'),
//                'file' => array('doc', 'docx', 'xls', 'xlsx', 'ppt', 'htm', 'html', 'txt', 'zip', 'rar', 'gz', 'bz2'),
//            ),
//最大文件大小
        $this->max_size = 1000000;
        $this->save_path = realpath($this->save_path) . '/';

        //load config file

        parent::init();
    }
1266417
public function actionActivate ()
		{
			if (Yii::$app->request->isAjax)
			{
				$post = Yii::$app->request->post();
				$page = Page::findOne($post[ 'id' ]);
				$page->updateAttributes([ 'active' => $page->active ? 0 : 1 ]);

				echo $page->active;
			}
			Yii::$app->end();
		}
727987
public function hasWebserviceConfiguration(string $webServiceId)
    {
        foreach ($this->configuration['connections'] as $serverId => $configuration) {
            if ($configuration['id'] == $webServiceId) {
                return $serverId;
            }
        }

        return false;
    }
1010544
public function getPoiList(array $data)
    {
        $result = $this->wechat->httpRaw(self::WECHAT_POI_LIST_GET_PREFIX, $data, [
            'access_token' => $this->wechat->getAccessToken()
        ]);
        return isset($result['errmsg']) && $result['errmsg'] === 'ok' ? $result['business_list'] : false;
    }
48718
public function bindLocationOtherShakeAroundDevice($device_identifier, $poi_id, $poi_appid)
    {
        if (!$this->access_token && !$this->getAccessToken()) {
            return false;
        }
        $data = array('device_identifier' => $device_identifier, 'poi_id' => $poi_id, "type" => 2, "poi_appid" => $poi_appid);
        $result = Tools::httpPost(self::API_BASE_URL_PREFIX . self::SHAKEAROUND_DEVICE_BINDLOCATION . "access_token={$this->access_token}", Tools::json_encode($data));
        if ($result) {
            $json = json_decode($result, true);
            if (empty($json) || !empty($json['errcode'])) {
                $this->errCode = isset($json['errcode']) ? $json['errcode'] : '505';
                $this->errMsg = isset($json['errmsg']) ? $json['errmsg'] : '无法解析接口返回内容！';
                return $this->checkRetry(__FUNCTION__, func_get_args());
            }
            return $json;
        }
        return false;
    }
270452
public function getInputsFromServiceId($conditionServiceId)
    {
        if (!$this->container->has($conditionServiceId)) {
            return false;
        }

        /** @var ConditionInterface $condition */
        $condition = $this->container->get($conditionServiceId);

        return $this->getInputsFromConditionInterface($condition);
    }
1363923
public function delNearByPoiList($poi_id)
    {
        $url = "https://api.weixin.qq.com/wxa/delnearbypoi?access_token=ACCESS_TOKEN";
        $this->registerApi($url, __FUNCTION__, func_get_args());
        return $this->callPostApi($url, ['poi_id' => $poi_id], true);
    }
915161
public static function isXDomainUser($uid)
	{
		$db = \App::get('db');

		$query = 'SELECT uidNumber FROM `#__xdomain_users` WHERE #__xdomain_users.uidNumber=' . $db->quote($uid);

		$db->setQuery($query);

		$result = $db->loadObject();

		if (empty($result))
		{
			return false;
		}

		return true;
	}
401019
public function initialize($pid)
	{
		if($this->user->tests()->instance($pid)->start())
			return true;
		else
			return false;
	}
1271560
public function getpoi($poi_id)
    {
        if (empty($poi_id) || !is_numeric($poi_id)) {
            $this->setError('参数错误');

            return false;
        }

        $queryStr           = [];
        $queryStr['poi_id'] = $poi_id;

        $res = $this->_post('getpoi', $queryStr);

        return $res;
    }
1289621
public function getRevCardDel(){
        if (isset($this->_receive['CardId']))     //卡券 ID
            $array['CardId'] = $this->_receive['CardId'];
        if (isset($this->_receive['UserCardCode']) && !empty($this->_receive['UserCardCode'])) //code 序列号。自定义 code 及非自定义 code的卡券被领取后都支持事件推送。
            $array['UserCardCode'] = $this->_receive['UserCardCode'];
        if (isset($array) && count($array) > 0) {
            return $array;
        } else {
            return false;
        }
    }