Beispiel #1
0
 /**
  * 获取所有或部分car
  * @param $params
  *  require    u      -- userid
  *   s   OK,others fail
  *   c   cars
  * 
  */
 public function get_cars(&$params)
 {
     $uid = $params['u'];
     $car = ModelFactory::UserCar();
     $ret['s'] = 'ok';
     $ret['c'] = $car->get($uid);
     return $ret;
 }
Beispiel #2
0
 /**
  *  收货物
  * @param $params
  * require  u  -- user_id
  * require  c  -- car be unlold
  * require  g  -- the goods to be unload
  * @return unknown_type
  * s   -- ok
  * c   -- car status
  * t   -- current time
  */
 public function get_goods($params)
 {
     //todo:添加购买验证逻辑
     //购买多个支持
     $uid = $params['u'];
     $car = ModelFactory::UserCar();
     $goods = ModelFactory::UserGood();
     $car->put_super($params['c'], $uid);
     $goods->put_super($params['g'], $uid);
     $ret['s'] = 'ok';
     $ret['t'] = time();
     return $ret;
 }