|
@@ -9,75 +9,76 @@
|
|
|
class ReserveController extends MoonClubBaseController
|
|
|
{
|
|
|
|
|
|
- public function actionIndex()
|
|
|
- {
|
|
|
- $status_option = CommonFn::getComboboxData(Reserve::$status_option, 1, true, 100);
|
|
|
- $this->render('index', [
|
|
|
- 'status_option' => $status_option
|
|
|
- ]);
|
|
|
- }
|
|
|
+ public function actionIndex()
|
|
|
+ {
|
|
|
+ $status_option = CommonFn::getComboboxData(Reserve::$status_option, 1, true, 100);
|
|
|
+ $this->render('index', [
|
|
|
+ 'status_option' => $status_option
|
|
|
+ ]);
|
|
|
+ }
|
|
|
|
|
|
- public function actionList()
|
|
|
- {
|
|
|
- $pageParams = CommonFn::getPageParams();
|
|
|
+ public function actionList()
|
|
|
+ {
|
|
|
+ $pageParams = CommonFn::getPageParams();
|
|
|
|
|
|
- $id = intval(Yii::app()->request->getParam('id'));
|
|
|
- $search = Yii::app()->request->getParam('search', '');
|
|
|
- $status = intval(Yii::app()->request->getParam('status', 100));
|
|
|
+ $id = intval(Yii::app()->request->getParam('id'));
|
|
|
+ $search = Yii::app()->request->getParam('search', '');
|
|
|
+ $status = intval(Yii::app()->request->getParam('status', 100));
|
|
|
|
|
|
- $criteria = new EMongoCriteria($pageParams);
|
|
|
- // id筛选
|
|
|
- if ($id) {
|
|
|
- $criteria->_id('==', new MongoId($id));
|
|
|
- }
|
|
|
- // 状态筛选
|
|
|
- if ($status != 100) {
|
|
|
- $criteria->status('==', $status);
|
|
|
- }
|
|
|
+ $criteria = new EMongoCriteria($pageParams);
|
|
|
+ // id筛选
|
|
|
+ if ($id) {
|
|
|
+ $criteria->_id('==', new MongoId($id));
|
|
|
+ }
|
|
|
+ // 状态筛选
|
|
|
+ if ($status != 100) {
|
|
|
+ $criteria->status('==', $status);
|
|
|
+ }
|
|
|
|
|
|
- $cursor = Reserve::model()->findAll($criteria);
|
|
|
- $rows = CommonFn::getRowsFromCursor($cursor);
|
|
|
- $parsedRows = Reserve::model()->parse($rows);
|
|
|
- $total = $cursor->count();
|
|
|
+ $cursor = Reserve::model()->findAll($criteria);
|
|
|
+ $rows = CommonFn::getRowsFromCursor($cursor);
|
|
|
+ $parsedRows = Reserve::model()->parse($rows);
|
|
|
+ $total = $cursor->count();
|
|
|
|
|
|
- echo CommonFn::composeDatagridData($parsedRows, $total);
|
|
|
+ echo CommonFn::composeDatagridData($parsedRows, $total);
|
|
|
|
|
|
- }
|
|
|
+ }
|
|
|
|
|
|
- public function actionEdit()
|
|
|
- {
|
|
|
- $status = intval(Yii::app()->request->getParam('status', 100));
|
|
|
+ public function actionEdit()
|
|
|
+ {
|
|
|
+ $status = intval(Yii::app()->request->getParam('status', 100));
|
|
|
$tech_content = Yii::app()->request->getParam('tech_content','');
|
|
|
-
|
|
|
- $id = Yii::app()->request->getParam('id');
|
|
|
+ $booking_time = intval(Yii::app()->request->getParam('booking_time',time()));
|
|
|
+ $id = Yii::app()->request->getParam('id');
|
|
|
if (empty($tech_content)){
|
|
|
$tech_content = "巾帼园";
|
|
|
}
|
|
|
if (!$id) {
|
|
|
- CommonFn::requestAjax(false, '');
|
|
|
- }
|
|
|
- if ($status == 100) {
|
|
|
- CommonFn::requestAjax(false, '请选择状态');
|
|
|
- }
|
|
|
+ CommonFn::requestAjax(false, '');
|
|
|
+ }
|
|
|
+ if ($status == 100) {
|
|
|
+ CommonFn::requestAjax(false, '请选择状态');
|
|
|
+ }
|
|
|
$reserve = Reserve::model()->get(new MongoId($id));
|
|
|
$reserve->status = $status;
|
|
|
$reserve->tech_content = $tech_content;
|
|
|
+ $reserve->booking_time = $booking_time;
|
|
|
$arr =array('status','tech_content');
|
|
|
- $success = $reserve->save(true,$arr);
|
|
|
- if ($success) {
|
|
|
- CommonFn::requestAjax(true, '修改成功');
|
|
|
- }
|
|
|
+ $success = $reserve->save(true,$arr);
|
|
|
+ if ($success) {
|
|
|
+ CommonFn::requestAjax(true, '修改成功');
|
|
|
+ }
|
|
|
|
|
|
- }
|
|
|
- //企业服务
|
|
|
- public function actionMonth()
|
|
|
- {
|
|
|
- $name = Yii::app()->request->getParam('user_name', '');
|
|
|
- $homeType = str_replace('string:', "", Yii::app()->request->getParam('homeType', ''));
|
|
|
- $num = str_replace('string:', "", Yii::app()->request->getParam('num', ''));
|
|
|
- $mobile = Yii::app()->request->getParam('mobile');
|
|
|
+ }
|
|
|
+ //企业服务
|
|
|
+ public function actionMonth()
|
|
|
+ {
|
|
|
+ $name = Yii::app()->request->getParam('user_name', '');
|
|
|
+ $homeType = str_replace('string:', "", Yii::app()->request->getParam('homeType', ''));
|
|
|
+ $num = str_replace('string:', "", Yii::app()->request->getParam('num', ''));
|
|
|
+ $mobile = Yii::app()->request->getParam('mobile');
|
|
|
$user_id = Yii::app()->getRequest()->getParam("user_id");
|
|
|
- if ($name) {
|
|
|
+ if ($name) {
|
|
|
if (!CommonFn::isMongoId($user_id)){
|
|
|
CommonFn::requestAjax(false,CommonFn::getMessage('user','id_not_exist'));
|
|
|
}
|
|
@@ -88,25 +89,25 @@ class ReserveController extends MoonClubBaseController
|
|
|
echo '请不要着急,等待客服的联系';
|
|
|
exit;
|
|
|
}
|
|
|
- $reserve = new Reserve();
|
|
|
+ $reserve = new Reserve();
|
|
|
$reserve->user = new MongoId($user_id);
|
|
|
|
|
|
$reserve->tech_content = '徐汇区天平路245号5楼';
|
|
|
|
|
|
- $reserve->user_name = $name;//名字
|
|
|
- $reserve->homeType = $homeType;//套餐类型
|
|
|
- $reserve->mobile = $mobile;//手机号
|
|
|
- $reserve->num = $num;//预产期
|
|
|
- $reserve->time = time();//咨询时间
|
|
|
- $reserve->type = '月子会所';
|
|
|
- $reserve->status = 1;
|
|
|
- if ($reserve->save()) {
|
|
|
- echo '您的咨询已发送成功,请等待我们的管家与您联系.<br/>温馨提示,一般是一个工作日内,日间致电给您,请留意。';
|
|
|
- exit;
|
|
|
- }
|
|
|
- }
|
|
|
- $this->render('month');
|
|
|
- }
|
|
|
+ $reserve->user_name = $name;//名字
|
|
|
+ $reserve->homeType = $homeType;//套餐类型
|
|
|
+ $reserve->mobile = $mobile;//手机号
|
|
|
+ $reserve->num = $num;//预产期
|
|
|
+ $reserve->time = time();//咨询时间
|
|
|
+ $reserve->type = '月子会所';
|
|
|
+ $reserve->status = 1;
|
|
|
+ if ($reserve->save()) {
|
|
|
+ echo '您的咨询已发送成功,请等待我们的管家与您联系.<br/>温馨提示,一般是一个工作日内,日间致电给您,请留意。';
|
|
|
+ exit;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $this->render('month');
|
|
|
+ }
|
|
|
public function actionMyService()
|
|
|
{
|
|
|
$user_id = Yii::app()->getRequest()->getParam("user_id");
|
|
@@ -124,12 +125,12 @@ class ReserveController extends MoonClubBaseController
|
|
|
if ($reserve->status == 2) {
|
|
|
$data[$key]['status'] = Reserve::$status_option[2];//已处理
|
|
|
} else {
|
|
|
- $data[$key]['status'] = Reserve::$status_option[1];//待处理
|
|
|
+ $data[$key]['status'] = Reserve::$status_option[1];//待处理
|
|
|
}
|
|
|
$data[$key]['num'] = $reserve->num;
|
|
|
-
|
|
|
- if($reserve->homeType == ''){
|
|
|
- $data[$key]['homeType'] = '未选择套餐';
|
|
|
+ $data[$key]['booking_time'] = $reserve->booking_time;
|
|
|
+ if ($reserve->homeType == '') {
|
|
|
+ $data[$key]['homeType'] = '未选择套餐';
|
|
|
} else {
|
|
|
$data[$key]['homeType'] = $reserve->homeType;
|
|
|
}
|
|
@@ -139,11 +140,11 @@ class ReserveController extends MoonClubBaseController
|
|
|
|
|
|
CommonFn::requestAjax(true,CommonFn::getMessage('message','operation_success'),$data);
|
|
|
}
|
|
|
- //享月会联系
|
|
|
- public function actionXyhIm()
|
|
|
- {
|
|
|
- $this->render('xyhIm');
|
|
|
- }
|
|
|
+ //享月会联系
|
|
|
+ public function actionXyhIm()
|
|
|
+ {
|
|
|
+ $this->render('xyhIm');
|
|
|
+ }
|
|
|
public function actionMyServices()
|
|
|
{
|
|
|
$user_id = Yii::app()->getRequest()->getParam("user_id");
|