1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- <?php
- namespace app\controllers;
- use Yii;
- use yii\filters\AccessControl;
- use yii\web\Controller;
- use yii\web\Response;
- use yii\filters\VerbFilter;
- use app\models\LoginForm;
- use app\models\ContactForm;
- use app\models\MappingStartModel;
- use app\models\entity\Tasktypes;
- use app\models\entity\Tasks;
- use app\models\entity\Tasknotes;
- use app\models\entity\Accounts;
- use app\models\entity\AccountsJobtypes;
- use app\models\entity\Sections;
- use app\models\entity\Companies;
- use app\models\entity\Jobtypes;
- use app\models\entity\ProjectsLocotech;
- use app\models\entity\Projecttypes;
- class MappingstartController extends MainController
- {
- public function beforeAction($action)
- {
- parent::beforeAction($action);
- //$date = strtotime('-3 weeks');
- //$this->threeWeeksAgo = date('Y-m-d', $date);
- $key = Yii::$app->request->headers->get('uuid-key');
- $this->checkAuth($key);
- //$headerContent = Yii::$app->request->headers->get('content-type');
- //\Yii::$app->response->format = \yii\web\Response::FORMAT_XML;
- //if ( 'application/json' == $headerContent ) {
- // \Yii::$app->response->format = \yii\web\Response::FORMAT_JSON;
- //}
- return true;
- }
- public function actionExecute($user_uuid = null) {
-
- if ( null == $user_uuid ) {
- return false;
- }
- $accountsEntity = Accounts::find()->where(['uuid' => $user_uuid])->one();
- if( null == $accountsEntity) {
- return false;
- }
- Yii::$app->db->createCommand('update `accounts_internal` set `last_seen_mobile` = NOW() where id in ('.$accountsEntity->id.')')->execute();
- $mappingStartModel = new MappingStartModel();
- $mappingStartModel->actionGetworks($accountsEntity->company);
-
- return true;
- }
- }
|