|
@@ -0,0 +1,70 @@
|
|
|
+<?php
|
|
|
+/**
|
|
|
+ * Created by PhpStorm.
|
|
|
+ * User: north.Deng
|
|
|
+ * Date: 2017/07/20
|
|
|
+ * Time: 10:53
|
|
|
+ * 用户详细信息
|
|
|
+ */
|
|
|
+class nutritious_meals extends MongoAr{
|
|
|
+ public $_id;
|
|
|
+ public $num; // 餐谱编号
|
|
|
+ public $xyh_order_id;// 订单编号
|
|
|
+ public $status;// 未预约 0 已预约 1 已确认
|
|
|
+ public $user_name;// 营养师
|
|
|
+ public $month_address;// 上门地址
|
|
|
+ public $posts_time;// 预约日期
|
|
|
+ public $end_time;// 确认日期
|
|
|
+ public $remarks;// 备注
|
|
|
+
|
|
|
+
|
|
|
+ public function __construct($scenario='insert'){
|
|
|
+ $this->setMongoDBComponent(Yii::app()->getComponent('mongodb_o2o'));
|
|
|
+ parent::__construct($scenario);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public static function model($className=__CLASS__)
|
|
|
+ {
|
|
|
+ return parent::model($className);
|
|
|
+ }
|
|
|
+
|
|
|
+ public function getCollectionName()
|
|
|
+ {
|
|
|
+ return 'nutritious_meals';
|
|
|
+ }
|
|
|
+
|
|
|
+ public static function get($_id) {
|
|
|
+ if(CommonFn::isMongoId($_id)){
|
|
|
+ $criteria = new EMongoCriteria();
|
|
|
+ $criteria->_id('==', $_id);
|
|
|
+ $model = self::model()->find($criteria);
|
|
|
+ return $model;
|
|
|
+ }else{
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public function parseRow($row,$output=array()){
|
|
|
+ $newRow = array();
|
|
|
+ $newRow['id'] = (string)$row['_id'];
|
|
|
+ $newRow['num'] = CommonFn::get_val_if_isset($row,'num','');
|
|
|
+ $newRow['xyh_order_id'] = CommonFn::get_val_if_isset($row,'xyh_order_id','');
|
|
|
+ $newRow['status'] = CommonFn::get_val_if_isset($row,'status','');
|
|
|
+ $newRow['user_name'] = CommonFn::get_val_if_isset($row,'user_name','');
|
|
|
+ $newRow['month_address'] = CommonFn::get_val_if_isset($row,'month_address','');
|
|
|
+ $newRow['posts_time'] = CommonFn::get_val_if_isset($row,'posts_time','');
|
|
|
+ $newRow['end_time'] = CommonFn::get_val_if_isset($row,'end_time','');
|
|
|
+ $newRow['remarks'] = CommonFn::get_val_if_isset($row,'remarks','');
|
|
|
+
|
|
|
+ if(APPLICATION=='admin'){
|
|
|
+ $newRow['action_user'] = CommonFn::get_val_if_isset($row,'action_user',"");
|
|
|
+ $newRow['action_time'] = CommonFn::get_val_if_isset($row,'action_time',"");
|
|
|
+ $newRow['action_log'] = CommonFn::get_val_if_isset($row,'action_log',"");
|
|
|
+
|
|
|
+ }
|
|
|
+ return $this->output($newRow,$output);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+}
|