<?php
/**
 * Created by PhpStorm.
 * User : zw
 * Date : 2017/12/7
 * Time : 15:16
 * Intro: c端首页资源 月均价 上周成交量
 */
namespace app\api\controller;

use app\api\extend\Basic;
use app\model\HouseInfos;
use app\model\JournalAccounts;

class Index extends Basic
{
  public function banner(){

  }

    /**
     * 月均价 上周成交量 ==>修改为日均价了
     */
  public function averagePriceAndTurnover(){

      $houseInfos = new HouseInfos();
      $averagePrice = $houseInfos->getAveragePrice();
      $journalAccounts = new JournalAccounts();
      $turnover     = $journalAccounts ->getTurnover();
      $result['averagePrice'] = $averagePrice;
      $result['turnover'] = $turnover;
      return $this->response("request success","200",$result);

  }
  
  /**
   * 处理错误的url
   * 
   * @return type
   */
  public function miss() {
      return $this->response('101','URL is error');
  }
}
