|
@@ -0,0 +1,124 @@
|
|
|
+<?php
|
|
|
+/**
|
|
|
+ * Created by north.Deng's MAC
|
|
|
+ * User: north.Deng
|
|
|
+ * Date: 2018/1/8
|
|
|
+ * Time: 上午10:03
|
|
|
+ * description :
|
|
|
+ */
|
|
|
+
|
|
|
+ class HouseKeeping extends MongoAr
|
|
|
+ {
|
|
|
+ public $_id;
|
|
|
+ public $user_id;
|
|
|
+ public $mobile;//手机号
|
|
|
+ public $address;//服务地址
|
|
|
+ public $type;//服务类型 0-钟点工;1-月嫂;2-育婴师;3-护理老人;4-全套家务
|
|
|
+ public $cart;//服务类型二级选项 0-住家,1-做一休一,2-做五休二,3-做六休一
|
|
|
+ public $server_start_time;//服务时间开始时间
|
|
|
+ public $server_end_time;//服务时间结束时间
|
|
|
+ public $skill;//服务技能 烧饭,保洁,育婴,护理,全套家务
|
|
|
+ public $yc_time;//预产期
|
|
|
+ public $age;//年龄
|
|
|
+ public $desc;//备注
|
|
|
+ public $status;//0-预约中,1-已预约,2-已面试
|
|
|
+ public $status_time;//预约日期
|
|
|
+ public $tech;//服务人员
|
|
|
+ public $contract;//签约状态
|
|
|
+ public $time;//创建时间
|
|
|
+
|
|
|
+
|
|
|
+ //服务形式
|
|
|
+ public static $type_option = array(
|
|
|
+ 1 => '钟点工',
|
|
|
+ 2 => '月嫂',
|
|
|
+ 3 => '育婴师',
|
|
|
+ 4 => '护理老人',
|
|
|
+ 5 => '全套家务',
|
|
|
+ );
|
|
|
+ public static $cart_options = array(
|
|
|
+ 1 => '住家',
|
|
|
+ 2 => '做一休一',
|
|
|
+ 3 => '做五休二',
|
|
|
+ 4 => '做六休一',
|
|
|
+ );
|
|
|
+ public static $skill_options = array(
|
|
|
+ 1 => '烧饭',
|
|
|
+ 2 => '保洁',
|
|
|
+ 3 => '育婴',
|
|
|
+ 4 => '护理',
|
|
|
+ 5 => '全套家务',
|
|
|
+ );
|
|
|
+ //预约状态
|
|
|
+ public static $status_option = array(
|
|
|
+ 1 => '预约中',
|
|
|
+ 2 => '已预约',
|
|
|
+ 3 => '已面试',
|
|
|
+ );
|
|
|
+ //签约状态
|
|
|
+ public static $contract_option = array(
|
|
|
+ 1 => '未签约',
|
|
|
+ 2 => '已签约',
|
|
|
+ );
|
|
|
+ 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 'house_kepping';
|
|
|
+ }
|
|
|
+
|
|
|
+ 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['user_id'] = CommonFn::get_val_if_isset($row,'user_id','');
|
|
|
+ $newRow['mobile'] = CommonFn::get_val_if_isset($row,'mobile','');
|
|
|
+ $newRow['address'] = CommonFn::get_val_if_isset($row,'address','');
|
|
|
+ $newRow['type'] = CommonFn::get_val_if_isset($row,'type','');
|
|
|
+ $newRow['cart'] = CommonFn::get_val_if_isset($row,'cart','');
|
|
|
+ $newRow['skill'] = CommonFn::get_val_if_isset($row,'skill','');
|
|
|
+ $newRow['server_end_time'] = CommonFn::get_val_if_isset($row,'server_end_time','');
|
|
|
+ $newRow['server_start_time'] = CommonFn::get_val_if_isset($row,'server_start_time','');
|
|
|
+ $newRow['yc_time'] = CommonFn::get_val_if_isset($row,'yc_time','');
|
|
|
+ $newRow['age'] = CommonFn::get_val_if_isset($row,'age','');
|
|
|
+ $newRow['status_time'] = CommonFn::get_val_if_isset($row,'status_time','');
|
|
|
+ $newRow['tech'] = CommonFn::get_val_if_isset($row,'tech','');
|
|
|
+ $newRow['contract'] = CommonFn::get_val_if_isset($row,'contract','');
|
|
|
+ $newRow['contract_srt'] = self::$contract_option[intval($newRow['contract'])];
|
|
|
+ $newRow['type_str'] = self::$type_option[intval($newRow['type'])];
|
|
|
+ $newRow['cart_str'] = self::$cart_options[intval($newRow['cart'])];
|
|
|
+ $newRow['skill_str'] = self::$skill_options[intval($newRow['skill'])];
|
|
|
+ $newRow['desc'] = CommonFn::get_val_if_isset($row,'desc','');
|
|
|
+ $newRow['status'] = CommonFn::get_val_if_isset($row,'status');
|
|
|
+ $newRow['status_str'] = self::$status_option[intval($newRow['status'])];
|
|
|
+ $newRow['time'] = CommonFn::get_val_if_isset($row,'time','');
|
|
|
+ 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);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|