|
@@ -2,11 +2,11 @@
|
|
|
/**
|
|
|
* UserController o2o用户相关接口
|
|
|
*
|
|
|
- *
|
|
|
+ *
|
|
|
*
|
|
|
*/
|
|
|
class UserController extends MoonClubBaseController{
|
|
|
-
|
|
|
+
|
|
|
public function actionInfo(){
|
|
|
$user_id = Yii::app()->getRequest()->getParam("user_id");
|
|
|
|
|
@@ -88,14 +88,48 @@ class UserController extends MoonClubBaseController{
|
|
|
public function actionXOrderByUserId()
|
|
|
{
|
|
|
$user_id = Yii::app()->request->getParam('user_id','');
|
|
|
- if (empty($user_id)) {
|
|
|
- CommonFn::requestAjax(false, CommonFn::getMessage('message', 'mobile_not_exits'));exit;
|
|
|
+ if (!CommonFn::isMongoId($user_id)) {
|
|
|
+ CommonFn::requestAjax(false, CommonFn::getMessage('message', 'id_not_exits'));exit;
|
|
|
}
|
|
|
$criteria = new EMongoCriteria();
|
|
|
- $criteria->user_id('==',$user_id);
|
|
|
+ $criteria->user_id('==',new MongoId($user_id));
|
|
|
$userInfos = XyhOrder::model()->findAll($criteria);
|
|
|
$row = CommonFn::getRowsFromCursor($userInfos);
|
|
|
- CommonFn::requestAjax(true, '成功',$row);exit;
|
|
|
+ $i = 0;
|
|
|
+ $data = array();
|
|
|
+ foreach ($userInfos as $key => $value) {
|
|
|
+ $criteria = new EMongoCriteria();
|
|
|
+ $criteria->xyh_order_id('==',(string)$value->_id);
|
|
|
+
|
|
|
+ $tmp = Docters::model()->findAll($criteria);
|
|
|
+ $tmp = CommonFn::getRowsFromCursor($tmp);
|
|
|
+ $data[$i]['docters'] = Docters::model()->parse($tmp);
|
|
|
+
|
|
|
+ $tmp = NutritiousMeals::model()->findAll($criteria);
|
|
|
+ $tmp = CommonFn::getRowsFromCursor($tmp);
|
|
|
+ $data[$i]['nutritiousMeals'] = NutritiousMeals::model()->parse($tmp);
|
|
|
+
|
|
|
+
|
|
|
+ $tmp = Techs::model()->findAll($criteria);
|
|
|
+ $tmp = CommonFn::getRowsFromCursor($tmp);
|
|
|
+ $data[$i]['techs'] = Techs::model()->parse($tmp);
|
|
|
+
|
|
|
+ $tmp = YsServices::model()->findAll($criteria);
|
|
|
+ $tmp = CommonFn::getRowsFromCursor($tmp);
|
|
|
+ $data[$i]['ysServices'] = YsServices::model()->parse($tmp);
|
|
|
+
|
|
|
+ $tmp = Prolactins::model()->findAll($criteria);
|
|
|
+ $tmp = CommonFn::getRowsFromCursor($tmp);
|
|
|
+ $data[$i]['prolactins'] = Prolactins::model()->parse($tmp);
|
|
|
+
|
|
|
+ $tmp = Foods::model()->findAll($criteria);
|
|
|
+ $tmp = CommonFn::getRowsFromCursor($tmp);
|
|
|
+ $data[$i++]['foods'] = Foods::model()->parse($tmp);
|
|
|
+ }
|
|
|
+ $rows = array();
|
|
|
+ $rows['xyh_orders'] = $row;
|
|
|
+ $rows['service_info'] = $data;
|
|
|
+ CommonFn::requestAjax(true, '成功',$rows);exit;
|
|
|
|
|
|
}
|
|
|
|