Message.php 560 B

12345678910111213141516171819202122232425
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Support\Facades\DB;
  4. class Message extends BaseModel
  5. {
  6. protected $table = "message";
  7. public $timestamps = false;
  8. public function add($title, $content, $from, $to, $type = 1, $addStatus = 2)
  9. {
  10. $data = ['title' => $title,
  11. 'content' => $content,
  12. 'formname' => $from,
  13. 'toname' => $to,
  14. 'add_time' => date ('Y-m-d H:i:s'),
  15. 'type' => $type,
  16. 'add_status' => $addStatus
  17. ];
  18. return self::insert ($data);
  19. }
  20. }