第三周心得体会

阅读数:704 发布时间:2016-07-31 20:25:07

作者:w3cbl 标签: w3cbl 心得 体会

心得体会

来到秀野堂第三周,主要学习了phalcon,doT,sui,以及自己看了一些JQuery,redis.虽然学完会用这些东西,但是自己的理解还不够,感觉有点生拉硬套的意思,需要自己长时间慢慢消化.来着三周,有点想家,虽然堂主在学习之余领我们开小灶,吃了丹阳的烧烤,但是和家里有很大差别,希望到上海后有机会回家转转,看看.期间和室友通了电话,又有了新的感触.希望自己能够继续坚持完成当时来到上海的目标吧.

代码

api接口

public function brandDetailsAction($app, $mt, $responseObj)
  {
    $brandid = $app->request->getPost('brand_id');
    $phql    = "select brand_pic,brand_logo,brand_name,brand_describe from Brand where brand_id = :brand_id:";
    $phql2   = "select thefirstpicture,goods_name,ori_price,dis_price,goods_id from Goods where brand_id = :brand_id: and recommend = 1";
    $rows    = $app->modelsManager->executeQuery($phql, array('brand_id'  => $brandid));
    $rows2   = $app->modelsManager->executeQuery($phql2, array('brand_id' => $brandid));
    $i = 0;
    foreach ($rows2 as $row) {
      $rj['pic']       = $row['thefirstpicture'];
      $rj['name']      = $row['goods_name'];
      $rj['ori_price'] = $row['ori_price'];
      $rj['dis_price'] = $row['dis_price'];
      $rj['goods_id']  = $row['goods_id'];
      $data[$i]        = $rj;
      $i++;
    }
    $responseObj                                      = array();
    $responseObj['status']                            = 1;
    $responseObj['msg']                               = 'ok';
    $responseObj['data']['brand_profile']['pic']      = $rows[0]['brand_pic'];
    $responseObj['data']['brand_profile']['logo']     = $rows[0]['brand_logo'];
    $responseObj['data']['brand_profile']['brand']    = $rows[0]['brand_name'];
    $responseObj['data']['brand_profile']['describe'] = $rows[0]['brand_describe'];
    $responseObj['data']['reco_goods']                = $data;
    $responseObj['timeSpend']                         = microtime() - $mt.'ms';
    return $responseObj;
  }

doT理解

首先要有模板,数据源,还要设置插入模板位置,模板中间要会使用for if的特定语句来实现数据呈现 和adapter有些类似.

相关文章推荐: