|
123456789101112131415161718192021222324252627282930313233 |
- <?php
- /**
- * Created by PhpStorm.
- * User: admin
- * Date: 2017/1/3
- * Time: 10:06
- */
-
- namespace backend\modules\motorcade\components;
-
- use yii\base\Component;
- use backend\modules\motorcade\models\BusOrderStatusLog;
-
- class BaseComponent extends Component
- {
- public static function addStatusLog($bus_number, $type, $beforeValue, $afterValue, $msg, $note = '', $user_id = null)
- {
-
- $statusLog = new BusOrderStatusLog();
- $statusLog->BUS_NUMBER = $bus_number;
- $statusLog->TYPE = $type;
- $statusLog->BEFORE_STATUS = $beforeValue;
- $statusLog->AFTER_STATUS = $afterValue;
- $statusLog->MSG = $msg;
- $statusLog->NOTE = $note;
- if($user_id !== null){
- $statusLog->CREATE_USER_ID = $user_id;
- $statusLog->UPDATE_USER_ID = $user_id;
- }
- $statusLog->save();
- }
-
- }
|