FaqueueLog.php 485 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: zhoujun
  5. * Date: 18-9-4
  6. * Time: 下午1:44
  7. */
  8. namespace addons\faqueue\model;
  9. use think\Config;
  10. use think\Db;
  11. use think\Model;
  12. class FaqueueLog extends Model
  13. {
  14. protected $autoWriteTimestamp = 'int';
  15. public function log($queue , $job, $data){
  16. return $this->data([
  17. 'job' => $job,
  18. 'queue' => $queue,
  19. 'data' => is_string($data) ? $data : json_encode($data),
  20. ])->save();
  21. }
  22. }