我有查询:
SELECT * FROM `users`
WHERE (`firstname` LIKE 'Luke' AND `lastname` LIKE 'Skywalker') OR
(`firstname` LIKE 'Foo' AND `lastname` LIKE 'Bar') OR
(`firstname` LIKE 'Tom' AND `lastname` LIKE 'Turner');
Run Code Online (Sandbox Code Playgroud)
但我想通过使用where ... in ...来尝试使其更具可读性
SELECT * FROM users
WHERE `firstname`
IN ('Luke','Foo','Tom') AND `lastname` IN ('Skywalker','Bar','Turner');
Run Code Online (Sandbox Code Playgroud)
但不幸的是,这也将匹配"Tom Skywalker","Foo Turner"所有混合你可以想到.
我必须选择first和lastname(也许更多字段,如DOB),因为我从外部API获取数据,我必须检查这些名称是否在我们的系统中.
我正在尝试使用Magento 2 rest API,但是即使只是从命令行卷曲,我得到的唯一响应是 Consumer is not authorized to access %resources
我设法获得了令牌
curl -X POST "http://magento.dev.blackorange.nl/index.php/rest/V1/integration/admin/token" \
-H "Content-Type:application/json" \
-d '{"username":"adminuser", "password":"adminpass"}'`
Run Code Online (Sandbox Code Playgroud)
但是当我尝试
curl -X GET -H "Authorization: Bearer TOKEN" "http://magento.dev.blackorange.nl/rest/V1/products"
Run Code Online (Sandbox Code Playgroud)
(或任何其他端点)我得到的,该Consumer is not authorized to access %resources消息
我在某处错过了一步吗?