Beispiel #1
0
 public function products()
 {
     $pkg = new Pkg();
     $productList = $pkg->getProductList();
     // 控制 Curl 请求错误
     $this->handleCurlError($pkg);
     // 按中文排序
     $nameList = array_map(function ($row) {
         return $row['chinese'];
     }, $productList);
     array_multisort($nameList, $productList);
     Flight::json($productList);
 }