|
@@ -7,6 +7,55 @@
|
|
|
*/
|
|
|
class AdvisoryController extends O2oBaseController {
|
|
|
|
|
|
+ public function actionIndex(){
|
|
|
+ $status_option = CommonFn::getComboboxData(TechInfo::$status_option, 1, true, 100);
|
|
|
+ $this->render('index', [
|
|
|
+ 'status_option' => $status_option
|
|
|
+ ]);
|
|
|
+ }
|
|
|
+ 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));
|
|
|
+
|
|
|
+ $criteria = new EMongoCriteria($pageParams);
|
|
|
+ // id筛选
|
|
|
+ if ($id) {
|
|
|
+ $criteria->_id('==', new MongoId($id));
|
|
|
+ }
|
|
|
+ // 状态筛选
|
|
|
+ if ($status != 100) {
|
|
|
+ $criteria->status('==', $status);
|
|
|
+ }
|
|
|
+ /* // 搜索
|
|
|
+ if ($search) {
|
|
|
+ // 搜索ID
|
|
|
+ if (!preg_match('/\D/', $search)) {
|
|
|
+ $criteria->_id('==', intval($search));
|
|
|
+ // 搜索姓名或微信ID
|
|
|
+ } else {
|
|
|
+ $criteria->name('or', new MongoRegex('/'.$search.'/'));
|
|
|
+ $criteria->wechat_id('or', new MongoRegex('/'.$search.'/'));
|
|
|
+ }
|
|
|
+ }*/
|
|
|
+
|
|
|
+ $cursor = Advisory::model()->findAll($criteria);
|
|
|
+ $rows = CommonFn::getRowsFromCursor($cursor);
|
|
|
+ $parsedRows = Advisory::model()->parse($rows);
|
|
|
+ $total = $cursor->count();
|
|
|
+ var_dump($parsedRows);
|
|
|
+ echo CommonFn::composeDatagridData($parsedRows, $total);
|
|
|
+
|
|
|
+ }
|
|
|
+ public function actionEdit(){
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
//名宿保洁
|
|
|
public function actionSinglesDay(){
|
|
|
|
|
@@ -24,6 +73,7 @@ class AdvisoryController extends O2oBaseController {
|
|
|
$advisory->mobile = $mobile;
|
|
|
$advisory->num = $num;
|
|
|
$advisory->area =$area;
|
|
|
+ $advisory->time = time();
|
|
|
$advisory->status = 0;
|
|
|
$advisory->tech_content = $tech_content;
|
|
|
if ($advisory->save()) {
|
|
@@ -49,6 +99,7 @@ class AdvisoryController extends O2oBaseController {
|
|
|
$advisory->mobile = $mobile;
|
|
|
$advisory->num = $num;
|
|
|
$advisory->area = $area;
|
|
|
+ $advisory->time = time();
|
|
|
$advisory->status = 0;
|
|
|
$advisory->tech_content = $tech_content;
|
|
|
if ($advisory->save()) {
|