QuestionHistory.php 620 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. namespace app\model\diseasequestionanswer;
  3. use think\Model;
  4. class QuestionHistory extends Model
  5. {
  6. /**
  7. * 表名
  8. */
  9. protected $table = "jm_question_history";
  10. public static function questionAnswerRecord($question , $answer , $phone)
  11. {
  12. $answer = $answer ? json_encode($answer) : '';
  13. /**
  14. * 记录提问问题
  15. */
  16. QuestionHistory::create(
  17. [
  18. 'phone' => $phone,
  19. 'question' => $question,
  20. 'answer' => $answer,
  21. 'createtime' => time()
  22. ]
  23. );
  24. }
  25. }