MongodbHandlerLog.php 952 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /**
  3. * Created by 上海互教教育科技有限公司.
  4. * User: 刘红伟
  5. * QQ : 454303753
  6. * Date: 2016/10/28 0028
  7. * Time: 上午 11:20
  8. */
  9. class MongodbHandlerLog extends EMongoDocument {
  10. public $school_id;
  11. public $coach_id;
  12. public $url;
  13. public $session;
  14. public $post;
  15. public $ip;
  16. public $create_time;
  17. public static function model($className = __CLASS__){
  18. return parent::model($className);
  19. }
  20. public function collectionName()
  21. {
  22. return 'coach_handler_logs';
  23. }
  24. public function add($school_id,$coach_id,$url,$session,$post,$ip) {
  25. $this->school_id = $school_id;
  26. $this->coach_id = $coach_id;
  27. $this->url = $url;
  28. $this->session = json_encode($session);
  29. $this->post = json_encode($post);
  30. $this->ip = $ip;
  31. $this->create_time = time();
  32. $this->insert();
  33. }
  34. }