更新商品信息
@param array $data
@return array
@throws Exceptions\InvalidResponseException
@throws Exceptions\LocalCacheException
338168
public function updateProduct(array $data)
    {
        $url = "https://api.weixin.qq.com/scan/product/update?access_token=ACCESS_TOKEN";
        $this->registerApi($url, __FUNCTION__, func_get_args());
        return $this->httpPostForJson($url, $data);
    }
724254
public function addPoi(array $data)
    {
        $result = $this->wechat->httpPost(self::WECHAT_POI_ADD_PREFIX, $data, [
            'access_token' => $this->wechat->getAccessToken()
        ]);
        return isset($result['errmsg']) && $result['errmsg'] === 'ok';
    }
1339131
public function update(array $data)
    {
        if (empty($data)) {
            return null;
        }

        if (!array_key_exists('id', $data) || !array_key_exists('email', $data)) {
            return null;
        }

        $data['api_action'] = 'contact_edit';
        $response = $this->request($data, 'POST');

        if ($response === null || $response->getStatusCode() !== 200) {
            return null;
        }

        $json = $response->getBody()->getContents();

        return $this->serializer->deserialize(
            $this->removeResultInformation($json),
            \FondOfPHP\ActiveCampaign\DataTransferObject\Contact::class,
            'json'
        );
    }
916227
public function update(array $data)
    {
        $where = [];
        $options = $this->parseExpress();
        $data    = array_merge($options['data'], $data);
        if (isset($options['cache']) && is_string($options['cache']['key'])) {
            $key = $options['cache']['key'];
        }
        $pk = $this->getPk();
        if (empty($options['where'])) {
            // 如果存在主键数据 则自动作为更新条件
            if (is_string($pk) && isset($data[$pk])) {
                $where[$pk] = $data[$pk];
                $key        = 'mongo:' . $options['table'] . '|' . $data[$pk];
                unset($data[$pk]);
            } elseif (is_array($pk)) {
                // 增加复合主键支持
                foreach ($pk as $field) {
                    if (isset($data[$field])) {
                        $where[$field] = $data[$field];
                    } else {
                        // 如果缺少复合主键数据则不执行
                        throw new Exception('miss complex primary data');
                    }
                    unset($data[$field]);
                }
            }
            if (!isset($where)) {
                // 如果没有任何更新条件则不执行
                throw new Exception('miss update condition');
            } else {
                $options['where']['$and'] = $where;
            }
        } elseif (!isset($key) && is_string($pk) && isset($options['where']['$and'][$pk])) {
            $key = $this->getCacheKey($options['where']['$and'][$pk], $options);
        }

        // 生成bulkWrite对象
        $bulk         = $this->builder->update($data, $options);
        $writeConcern = isset($options['writeConcern']) ? $options['writeConcern'] : null;
        $writeResult  = $this->execute($options['table'], $bulk, $writeConcern);

        $result = $writeResult->getModifiedCount();
        if ($result) {
            if (isset($where[$pk])) {
                $data[$pk] = $where[$pk];
            } elseif (is_string($pk) && isset($key) && strpos($key, '|')) {
                list($a, $val) = explode('|', $key);
                unset($a);
                $data[$pk]     = $val;
            }
            $options['data'] = $data;
            $this->trigger('after_update', $options);
        }
        return $result;
    }
1020949
public function getUserCumulate(array $data)
    {
        $result = $this->wechat->httpRaw(self::WECHAT_USER_CUMULATE_GET_PREFIX, $data, [
            'access_token' => $this->wechat->getAccessToken()
        ]);
        return isset($result['list']) ? $result['list'] : false;
    }
794333
protected function prepareData($data)
    {
        if(!is_array($data))
        {
            $data = [];
        }
        
        $data['access_token'] = $this->config->accessToken;
        
        return http_build_query($data);
    }
814434
public function updatePage(array $data)
    {
        $result = $this->wechat->httpRaw(self::WECHAT_UPDATE_PREFIX, $data, [
            'access_token' => $this->wechat->getAccessToken()
        ]);
        return isset($result['errcode']) && !$result['errcode'] ? $result['data'] : false;
    }
40085
public function update(array $data)
    {
        $project_id = (int) (empty($data['project_id']) ? 0: $data['project_id']);
        $person_id = (int) (empty($data['person_id']) ? 0: $data['person_id']);
        if ($project_id <= 0) {
            throw new Exception("Required field project_id");
        }
        if ($person_id <= 0) {
            throw new Exception("Required field person_id");
        }
        return $this->rest->put("projects/$project_id/people/$person_id", $data);
    }
1142595
public function update(array $data)
    {
        $id = (int) empty($data['id']) ? 0 : $data['id'];
        if ($id <= 0) {
            throw new Exception('Required field id');
        }
        $person_id = empty($data['person_id']) ? 0 : (int) $data['person_id'];
        unset($data['id'], $data['person_id']);
        return $this->rest->put('people/' .
           ($person_id ? $person_id . '/' : '') .  "$this->action/$id", $data);
    }
971851
public function updateIndexOne(array $data)
    {
        if (!is_array($data)) {
            throw new \Exception('你的索引参数不是一个数组');
        }

        if (count($data) == count($data, 1)) {
            // 一维数组
            $this->getIndex()->update(new \XSDocument($data));
        }

        //索引是否立即生效
        if ($this->flush_index) {
            $this->getIndex()->flushIndex();
        }

        return $this->getIndex();
    }
605651
public function addNews($data)
    {
        $url = "https://api.weixin.qq.com/cgi-bin/material/add_news?access_token=ACCESS_TOKEN";
        $this->registerApi($url, __FUNCTION__, func_get_args());
        return $this->httpPostForJson($url, $data);
    }
962465
public function updateGroup(array $data)
    {
        $result = $this->wechat->httpRaw(self::WECHAT_GROUP_UPDATE_PREFIX, $data, [
            'access_token' => $this->wechat->getAccessToken()
        ]);
        return isset($result['errmsg']) && $result['errmsg'] == 'success';
    }
880850
public function updateDeliverTemplate(array $data)
    {
        $result = $this->wechat->httpRaw(self::WECHAT_DELIVERY_TEMPLATE_UPDATE_PREFIX, $data, [
            'access_token' => $this->wechat->getAccessToken()
        ]);
        return isset($result['errmsg']) && $result['errmsg'] == 'success';
    }
587165
public function updateUser(array $data)
    {
        $result = $this->httpRaw(self::WECHAT_USER_UPDATE_PREFIX, $data, [
            'access_token' => $this->getAccessToken()
        ]);
        return isset($result['errcode']) && !$result['errcode'];
    }
194486
public function updateData($data)
    {
        $isMobileVerified = $this->isMobileVerified();

        $validator = wei()->validate([
            'data' => $data,
            'rules' => [
                'mobile' => [
                    'required' => !$isMobileVerified,
                    'mobileCn' => true,
                ],
                'name' => [
                    'required' => false,
                ],
                'address' => [
                    'required' => false,
                    'minLength' => 3,
                ],
            ],
            'names' => [
                'mobile' => '手机号码',
                'name' => '姓名',
                'address' => '详细地址',
            ],
        ]);
        if (!$validator->isValid()) {
            return $this->err($validator->getFirstMessage());
        }

        if (!$isMobileVerified) {
            // 手机号未认证时,检查手机号,根据配置检查是否重复
            if (wei()->setting('user.check_mobile_unique') && $this->isMobileExists($data['mobile'])) {
                return $this->err('手机号码已存在');
            }
            $this['mobile'] = $data['mobile'];
        }

        $result = $this->event->until('preUserUpdate', [$data, $this]);
        if ($result) {
            return $result;
        }

        $this->save([
            'name' => $data['name'],
            'address' => $data['address'],
        ]);

        return $this->suc();
    }
505590
public function update($data)
    {
        if (isset($data['stackName'])) {
            $txt = Core::make('helper/text');
            $data['cName'] = $data['stackName'];
            $data['cHandle'] = str_replace('-', Config::get('concrete.seo.page_path_separator'), $txt->urlify($data['stackName']));
        }
        $worked = parent::update($data);

        if (isset($data['stackName'])) {
            // Make sure the stack path is always up-to-date after a name change
            $this->rescanCollectionPath();

            $db = Database::connection();
            $stackName = $data['stackName'];
            $db->Execute('update Stacks set stName = ? WHERE cID = ?', [$stackName, $this->getCollectionID()]);
        }

        return $worked;
    }
1169807
public function update(array $data) {
        $sql = $this->grammar()->compileUpdate($this, $data);
        return $this->command()
            ->update($sql, $this->getBindings());
    }