Bläddra i källkod

Merge branch 'test' of git.oschina.net:yiguanjia/php into test

seam 8 år sedan
förälder
incheckning
17b52bc0e7

+ 65 - 4
www/protected/modules/moonclub/controllers/EmployeController.php

@@ -13,10 +13,11 @@ class EmployeController extends MoonClubBaseController {
     {
         $auth = Yii::app()->request->getParam('auth',0);
         $user_name = Yii::app()->request->getParam('user_name','');
+
         $criteria = new EMongoCriteria();
-        $criteria->auth('==',$auth);//角色
+        $criteria->auth('==',intval($auth));//角色
         $criteria->status('==',0);//在岗
-        $criteria->user_name('or',new MongoRegex('/'.$user_name.'/'));//匹配用户名
+        $criteria->addCond('user_name','or',new MongoRegex('/'.$user_name.'/'));//匹配用户名
         $employers = Employe::model()->findAll($criteria);
         $result = array();
         $index  = 0;
@@ -59,6 +60,7 @@ class EmployeController extends MoonClubBaseController {
 
     public function actionSaveEmployeInfo()
     {
+
         $address = array();
         $user_id = Yii::app()->request->getParam('user_id','');//user $_id
         $user_name = Yii::app()->request->getParam('user_name','');//用户名
@@ -83,7 +85,7 @@ class EmployeController extends MoonClubBaseController {
         $criteria = new EMongoCriteria();
         $criteria->user_id('==',$user_id);
         $tmp = Employe::model()->find($criteria);
-        if (!empty($tmp)) {
+        if (empty($tmp)) {
             CommonFn::requestAjax(false, '您已经完善过资料');exit;
         }
         $employe = new Employe();
@@ -100,12 +102,71 @@ class EmployeController extends MoonClubBaseController {
         $employe->type_of_work = $type_of_work;
         $employe->skil = $skil;
         $employe->work_year = $work_year;
-        $employe->auth = $auth;
+        $employe->auth = $auth-1;
         $employe->desc = $desc;
         $employe->status = 3;//待审核
         $employe->save();
+
         CommonFn::requestAjax(true, '保存成功');exit;
 
     }
 
+    public function actionGetTechInfoByUserId()
+    {
+
+        $user_id = Yii::app()->request->getParam('user_id','');
+        if (!CommonFn::isMongoId($user_id)) {
+            CommonFn::requestAjax(false,'user_id not_exits');exit;
+        }
+        $criteria = new EMongoCriteria();
+        $criteria->user_id('==',$user_id);
+        $employe = Employe::model()->find($criteria);
+        if (empty($employe)) {
+            CommonFn::requestAjax(false,'用户不存在');exit;
+        }
+        $criteria = new EMongoCriteria();
+        $criteria->employe_id = (string)$employe->_id;
+        $criteria->sort('xyh_order_id',EMongoCriteria::SORT_ASC);
+        switch (intval($employe->auth)) {
+            case 0:
+                $tmp = Docters::model()->findAll($criteria);
+                break;//中医
+            case 1:
+                $tmp = NutritiousMeals::model()->findAll($criteria);
+                break;//营养师
+            case 2:
+                $tmp = Techs::model()->findAll($criteria);
+               break;//保洁师
+            case 3:
+                $tmp = YsServices::model()->findAll($criteria);
+
+                break;//月嫂
+            case 4:
+                $tmp = Prolactins::model()->findAll($criteria);
+
+                break;//催乳师
+            case 5:
+                $tmp = Foods::model()->findAll($criteria);
+                break;//配送师
+            case 6:
+                break;//暂留
+        }
+        $row = CommonFn::getRowsFromCursor($tmp);
+        CommonFn::requestAjax(true,CommonFn::getMessage('message','operation_success'),$row);
+
+    }
+
+    public function actionQueryPersonalInfoByUserId()
+    {
+        $user_id = Yii::app()->request->getParam('user_id','');
+        $criteria = new EMongoCriteria();
+        $criteria->user_id('==',$user_id);
+        $user_info = Employe::model()->find($criteria);
+        if (!empty($user_info)) {
+            CommonFn::requestAjax(true,'已经注册过',$user_info);exit;
+        } else {
+            CommonFn::requestAjax(false,'未注册');exit;
+        }
+    }
+
 }

+ 16 - 0
www/protected/modules/moonclub/controllers/REmployeController.php

@@ -31,4 +31,20 @@ class REmployeController extends AdminController {
         $total = $cursor->count();
         echo CommonFn::composeDatagridData($parsedRows, $total);
     }
+
+    public function actionEdit()
+    {
+        $id = Yii::app()->request->getParam('id','');
+        $status = intval(Yii::app()->request->getParam('status',100));
+        if ($status == 100) {
+            CommonFn::requestAjax(false,'状态没有修改');exit;
+        }
+        if (!CommonFn::isMongoId($id)) {
+            CommonFn::requestAjax(false,'id错误');exit;
+        }
+        $employe = Employe::get(new MongoId($id));
+        $employe->status = $status;
+        $employe->save();
+        CommonFn::requestAjax(true,'保存成功');exit;
+    }
 }

+ 1 - 1
www/protected/modules/moonclub/controllers/WebController.php

@@ -2,7 +2,6 @@
 class WebController extends MoonClubBaseController {
 
     public function actionIndex() {
-
         $signPackage = CommonWeixin::get_sign1();
         $home_page = Yii::app()->getRequest()->getParam("home_page",'');
         $code = Yii::app()->getRequest()->getParam("code");
@@ -30,6 +29,7 @@ class WebController extends MoonClubBaseController {
                             $user->wx_pub_openid = $accessInfo['openid'];
                             $user->wx_have_follow = 1;
                             $user->update(array('wx_pub_openid','wx_have_follow'),true);
+
                         }
                     }else{
                         $userAr  = new RUser();

+ 9 - 2
www/protected/modules/moonclub/controllers/XOrderController.php

@@ -11,7 +11,7 @@ class XOrderController extends AdminController {
     public function actionIndex()
     {
 
-        $status = CommonFn::getComboboxData(Employe::$auth_option, 0, false);
+        $status = CommonFn::getComboboxData(Employe::$auth_option, 100, true,100);
         $package_product = CommonFn::getComboboxData(XyhOrder::$package_option, 1);
 
         $this->render('index', array(
@@ -139,13 +139,14 @@ class XOrderController extends AdminController {
     }
 
     public function actionAddTechInfo() {
-        $xorder_id = Yii::app()->request->getParam('xorder_id','');
+        $xorder_id = Yii::app()->request->getParam('id','');
         $status = Yii::app()->request->getParam('status',0);
         $user_name = Yii::app()->request->getParam('employer_name','');
         $address = Yii::app()->request->getParam('address','');
         $booking_time = Yii::app()->request->getParam('booking_time','');
         $start_time = Yii::app()->request->getParam('start_time','');
         $desc = Yii::app()->request->getParam('desc','');
+        $employe_id = Yii::app()->request->getParam('employe_id','');
         switch ($status) {
             case 0:
                 $report_time = Yii::app()->request->getParam('report_time','');
@@ -159,6 +160,7 @@ class XOrderController extends AdminController {
                 $doctor->diagnos_time = $start_time;
                 $doctor->report_time = $report_time;
                 $doctor->remarks = $desc;
+                $doctor->employe_id = $employe_id;
                 $doctor->save();
                 CommonFn::requestAjax(true, '保存成功');
                 break;//中医
@@ -172,6 +174,7 @@ class XOrderController extends AdminController {
                 $nutritious->posts_time = $booking_time;
                 $nutritious->end_time = $start_time;
                 $nutritious->remarks = $desc;
+                $nutritious->employe_id = $employe_id;
                 $nutritious->save();
                 CommonFn::requestAjax(true, '保存成功');
                 break;//营养师
@@ -185,6 +188,7 @@ class XOrderController extends AdminController {
                 $tech->posts_time = $booking_time;
                 $tech->end_time = $start_time;
                 $tech->remarks = $desc;
+                $tech->employe_id = $employe_id;
                 $tech->save();
                 CommonFn::requestAjax(true, '保存成功');
                 break;//保洁师
@@ -198,6 +202,7 @@ class XOrderController extends AdminController {
                 $ys->posts_time = $booking_time;
                 $ys->end_time = $start_time;
                 $ys->remarks = $desc;
+                $ys->employe_id = $employe_id;
                 $ys->save();
                 CommonFn::requestAjax(true, '保存成功');
                 break;//月嫂
@@ -211,6 +216,7 @@ class XOrderController extends AdminController {
                 $prolactins->posts_time = $booking_time;
                 $prolactins->end_time = $start_time;
                 $prolactins->remarks = $desc;
+                $prolactins->employe_id = $employe_id;
                 $prolactins->save();
                 CommonFn::requestAjax(true, '保存成功');
                 break;//催乳师
@@ -224,6 +230,7 @@ class XOrderController extends AdminController {
                 $food->posts_time = $booking_time;
                 $food->end_time = $start_time;
                 $food->remarks = $desc;
+                $food->employe_id = $employe_id;
                 $food->save();
                 CommonFn::requestAjax(true, '保存成功');
                 break;//配送师

+ 49 - 48
www/protected/modules/moonclub/models/Accessories.php

@@ -7,64 +7,65 @@
  * 用户详细信息
  */
 class Accessories 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 $_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 $employe_id;
 
-
-  public function __construct($scenario='insert'){
-    $this->setMongoDBComponent(Yii::app()->getComponent('mongodb_o2o'));
-    parent::__construct($scenario);
-  }
+    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 static function model($className=__CLASS__)
+    {
+        return parent::model($className);
+    }
 
-  public function getCollectionName()
-  {
-    return 'accessories';
-  }
+    public function getCollectionName()
+    {
+        return 'accessories';
+    }
 
-  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 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','');
+    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','');
+        $newRow['employe_id'] = CommonFn::get_val_if_isset($row,'employe_id','');
 
-    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',"");
+        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);
     }
-    return $this->output($newRow,$output);
-  }
 
 
 }

+ 51 - 50
www/protected/modules/moonclub/models/Docters.php

@@ -7,66 +7,67 @@
  * 用户详细信息
  */
 class Docters extends MongoAr{
-  public $_id;
-  public $num; // 诊脉编号
-  public $xyh_order_id;// 订单编号
-  public $status;// 未预约 0 已预约 1 已诊脉 2
-  public $user_name;// 医生姓名
-  public $diagnos_address;// 诊脉地址
-  public $reserve_time;// 预约日期
-  public $diagnos_time;// 诊脉日期
-  public $report_time;// 报告日期
-  public $remarks;// 备注
+    public $_id;
+    public $num; // 诊脉编号
+    public $xyh_order_id;// 订单编号
+    public $status;// 未预约 0 已预约 1 已诊脉 2
+    public $user_name;// 医生姓名
+    public $diagnos_address;// 诊脉地址
+    public $reserve_time;// 预约日期
+    public $diagnos_time;// 诊脉日期
+    public $report_time;// 报告日期
+    public $employe_id;//employe_id
+    public $remarks;// 备注
 
-
-  public function __construct($scenario='insert'){
-    $this->setMongoDBComponent(Yii::app()->getComponent('mongodb_o2o'));
-    parent::__construct($scenario);
-  }
+    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 static function model($className=__CLASS__)
+    {
+        return parent::model($className);
+    }
 
-  public function getCollectionName()
-  {
-    return 'docters';
-  }
+    public function getCollectionName()
+    {
+        return 'docters';
+    }
 
-  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 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['diagnos_address'] = CommonFn::get_val_if_isset($row,'diagnos_address','');
-    $newRow['reserve_time'] = CommonFn::get_val_if_isset($row,'reserve_time','');
-    $newRow['diagnos_time'] = CommonFn::get_val_if_isset($row,'diagnos_time','');
-    $newRow['report_time'] = CommonFn::get_val_if_isset($row,'report_time','');
-    $newRow['remarks'] = CommonFn::get_val_if_isset($row,'remarks','');
+    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['diagnos_address'] = CommonFn::get_val_if_isset($row,'diagnos_address','');
+        $newRow['reserve_time'] = CommonFn::get_val_if_isset($row,'reserve_time','');
+        $newRow['diagnos_time'] = CommonFn::get_val_if_isset($row,'diagnos_time','');
+        $newRow['report_time'] = CommonFn::get_val_if_isset($row,'report_time','');
+        $newRow['remarks'] = CommonFn::get_val_if_isset($row,'remarks','');
+        $newRow['employe_id'] = CommonFn::get_val_if_isset($row,'employe_id','');
 
-    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',"");
+        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);
     }
-    return $this->output($newRow,$output);
-  }
 
 
 }

+ 1 - 1
www/protected/modules/moonclub/models/Employe.php

@@ -85,7 +85,7 @@ class Employe extends MongoAr {
         $newRow['skil'] = CommonFn::get_val_if_isset($row,'skil','');
         $newRow['work_year'] = CommonFn::get_val_if_isset($row,'work_year','');
         $newRow['auth'] = CommonFn::get_val_if_isset($row,'auth','');
-        $newRow['auth_str'] = Employe::$auth_option[intval($newRow['auth']-1)];
+        $newRow['auth_str'] = Employe::$auth_option[intval($newRow['auth'])];
         $newRow['address'] = CommonFn::get_val_if_isset($row,'address','');
         $newRow['status'] = CommonFn::get_val_if_isset($row,'status','');
         $newRow['status_str'] = Employe::$status_option[intval($newRow['status'])];

+ 49 - 49
www/protected/modules/moonclub/models/Foods.php

@@ -7,64 +7,64 @@
  * 用户详细信息
  */
 class Foods 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 $_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 $employe_id;
 
+    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 'foods';
-  }
+    public static function model($className=__CLASS__)
+    {
+        return parent::model($className);
+    }
 
-  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 getCollectionName()
+    {
+        return 'foods';
     }
-  }
 
-  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','');
+    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;
+        }
+    }
 
-    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',"");
+    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','');
+        $newRow['employe_id'] = CommonFn::get_val_if_isset($row,'employe_id','');
+        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);
     }
-    return $this->output($newRow,$output);
-  }
 
 
 }

+ 49 - 49
www/protected/modules/moonclub/models/NutritiousMeals.php

@@ -7,64 +7,64 @@
  * 用户详细信息
  */
 class NutritiousMeals 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 $_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 $employe_id;
 
+    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 model($className=__CLASS__)
+    {
+        return parent::model($className);
+    }
 
-  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 getCollectionName()
+    {
+        return 'nutritious_meals';
     }
-  }
 
-  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','');
+    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;
+        }
+    }
 
-    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',"");
+    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','');
+        $newRow['employe_id'] = CommonFn::get_val_if_isset($row,'employe_id','');
+        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);
     }
-    return $this->output($newRow,$output);
-  }
 
 
 }

+ 49 - 49
www/protected/modules/moonclub/models/Prolactins.php

@@ -7,64 +7,64 @@
  * 用户详细信息
  */
 class Prolactins 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 $_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 $employe_id;
 
+    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 'prolactins';
-  }
+    public static function model($className=__CLASS__)
+    {
+        return parent::model($className);
+    }
 
-  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 getCollectionName()
+    {
+        return 'prolactins';
     }
-  }
 
-  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','');
+    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;
+        }
+    }
 
-    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',"");
+    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','');
+        $newRow['employe_id'] = CommonFn::get_val_if_isset($row,'employe_id','');
+        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);
     }
-    return $this->output($newRow,$output);
-  }
 
 
 }

+ 49 - 48
www/protected/modules/moonclub/models/Techs.php

@@ -7,64 +7,65 @@
  * 用户详细信息
  */
 class Techs 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 $_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 $employe_id;
 
-
-  public function __construct($scenario='insert'){
-    $this->setMongoDBComponent(Yii::app()->getComponent('mongodb_o2o'));
-    parent::__construct($scenario);
-  }
+    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 static function model($className=__CLASS__)
+    {
+        return parent::model($className);
+    }
 
-  public function getCollectionName()
-  {
-    return 'techs';
-  }
+    public function getCollectionName()
+    {
+        return 'techs';
+    }
 
-  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 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','');
+    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','');
+        $newRow['employe_id'] = CommonFn::get_val_if_isset($row,'employe_id','');
 
-    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',"");
+        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);
     }
-    return $this->output($newRow,$output);
-  }
 
 
 }

+ 49 - 49
www/protected/modules/moonclub/models/YsServices.php

@@ -7,64 +7,64 @@
  * 用户详细信息
  */
 class YsServices 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 $_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 $employe_id;
 
+    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 'ys_services';
-  }
+    public static function model($className=__CLASS__)
+    {
+        return parent::model($className);
+    }
 
-  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 getCollectionName()
+    {
+        return 'ys_services';
     }
-  }
 
-  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','');
+    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;
+        }
+    }
 
-    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',"");
+    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','');
+        $newRow['employe_id'] = CommonFn::get_val_if_isset($row,'employe_id','');
+        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);
     }
-    return $this->output($newRow,$output);
-  }
 
 
 }

+ 4 - 1
www/protected/modules/moonclub/views/rEmploye/index.php

@@ -359,6 +359,9 @@
         $('#xorder_id').val(row.id);
       },
       onLoadSuccess : function () {
+        $('#id_str').html('');
+        $('#xorder_id').val('');
+        $('#setStatus').val(100);
 
       }
 
@@ -379,7 +382,7 @@
     jq_content_form.form({
       url: module_router + '/edit',
       onSubmit: function(param){
-        if ($('#order_id').val() == ""){
+        if ($('#xorder_id').val() == ""){
           return false;
         }
         var isValid = $(this).form('validate');

+ 20 - 4
www/protected/modules/moonclub/views/xOrder/index.php

@@ -62,6 +62,7 @@
                     </div>
                     <div class="box_flex f_content">
                       <input name="employer_name" id="employer_name" />
+                      <input id="employe_id" name="employe_id" style="width: 250px;" type="hidden" />
                     </div>
                   </div>
                 </li>
@@ -424,8 +425,6 @@
       editable: false,
       data: status_data,
       onSelect: function(res){
-        $('#jq_auth_info').val(res.value);
-        console.log($('#jq_auth_info').val());
         //自动查询
         $('#employer_name').coolautosuggest({
           url: "index.php?r=moonclub/employe/EmployerDetail&auth="+res.value+"&user_name=",
@@ -434,12 +433,12 @@
           onSelected: function (result) {
             if (result != null) {
               console.log(result)
+              $('#employe_id').val(result.description)
             } else {
               return false;
             }
           }
         })
-        tmp = $('#jq_auth_info').val()
         if (res.value == 0) {
           $('#report_show').show();
         } else {
@@ -579,6 +578,23 @@
       },
       onLoadSuccess : function () {
 
+        jq_content_form.form('clear');
+
+        jq_dg_content.datagrid('clearSelections');
+        jq_setStatus.combobox('setValue', 100);
+        $('#employe_id').val('')
+        $('#id_str').html('');
+        $('#xorder_id').val('');
+        $('#employer_name').val('');
+        $('#address').val('');
+        $('#').val('');
+        $('#booking_time_str').val('');
+        $('#start_time').val('');
+        $('#start_time_str').val('');
+        $('#report_time').val('');
+        $('#jq_auth_info').val('');
+        $('#desc').val('');
+
       }
 
     });
@@ -596,7 +612,7 @@
 
 
     jq_content_form.form({
-      url: module_router + '/edit',
+      url: module_router + '/AddTechInfo',
       onSubmit: function(param){
         if ($('#order_id').val() == ""){
           return false;