You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

33 lines
855 B

  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: admin
  5. * Date: 2017/1/3
  6. * Time: 10:06
  7. */
  8. namespace backend\modules\motorcade\components;
  9. use yii\base\Component;
  10. use backend\modules\motorcade\models\BusOrderStatusLog;
  11. class BaseComponent extends Component
  12. {
  13. public static function addStatusLog($bus_number, $type, $beforeValue, $afterValue, $msg, $note = '', $user_id = null)
  14. {
  15. $statusLog = new BusOrderStatusLog();
  16. $statusLog->BUS_NUMBER = $bus_number;
  17. $statusLog->TYPE = $type;
  18. $statusLog->BEFORE_STATUS = $beforeValue;
  19. $statusLog->AFTER_STATUS = $afterValue;
  20. $statusLog->MSG = $msg;
  21. $statusLog->NOTE = $note;
  22. if($user_id !== null){
  23. $statusLog->CREATE_USER_ID = $user_id;
  24. $statusLog->UPDATE_USER_ID = $user_id;
  25. }
  26. $statusLog->save();
  27. }
  28. }