FecshopServiceLog.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. /**
  3. * FecShop file.
  4. *
  5. * @link http://www.fecshop.com/
  6. * @copyright Copyright (c) 2016 FecShop Software LLC
  7. * @license http://www.fecshop.com/license/
  8. */
  9. namespace fecshop\models\mongodb;
  10. use yii\mongodb\ActiveRecord;
  11. /**
  12. * @author Terry Zhao <2358269014@qq.com>
  13. * @since 1.0
  14. */
  15. class FecshopServiceLog extends ActiveRecord
  16. {
  17. /**
  18. * mongodb collection 的名字,相当于mysql的table name
  19. */
  20. public static function collectionName()
  21. {
  22. return 'fecshop_service_log';
  23. }
  24. /**
  25. * mongodb是没有表结构的,因此不能像mysql那样取出来表结构的字段作为model的属性
  26. * 因此,需要自己定义model的属性,下面的方法就是这个作用
  27. */
  28. public function attributes()
  29. {
  30. return [
  31. '_id',
  32. 'service_file',
  33. 'service_method',
  34. 'service_method_argument',
  35. 'begin_microtime',
  36. 'end_microtime',
  37. 'used_time',
  38. 'process_date_time',
  39. ];
  40. }
  41. }