本文整理匯總了PHP中dao::listCommodities方法的典型用法代碼示例。如果您正苦於以下問題:PHP dao::listCommodities方法的具體用法?PHP dao::listCommodities怎麽用?PHP dao::listCommodities使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類dao
的用法示例。
在下文中一共展示了dao::listCommodities方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: index
/**
* Display a listing of the resource.
*
* @param $lang
* @return \Illuminate\Http\Response
* @internal param Request $request
*/
public function index($lang)
{
header('Content-Type: application/json');
header('Access-Control-Allow-Origin: *');
$properties['country'] = Input::get('country');
$properties['flow'] = Input::get('flow');
$properties['from_date'] = Input::get('from_date');
$properties['to_date'] = Input::get('to_date');
$properties['lang'] = $lang;
$commodities = $this->dao->listCommodities($properties);
if (empty($commodities)) {
return response('No data found', Response::HTTP_NO_CONTENT);
}
$response = json_encode($commodities, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE);
return response($response, Response::HTTP_OK);
}