菜谱项目

SearchRecord.php 483B

12345678910111213141516171819202122
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Model;
  4. use Illuminate\Support\Facades\DB;
  5. class SearchRecord extends Model
  6. {
  7. protected $table = 'search_record';
  8. public $timestamps = false;
  9. public static function insertSearchValue($value, $type = 0)
  10. {
  11. $re = DB::table('search_record')->insert([
  12. 'value' => $value,
  13. 'type' => $type,
  14. 'created_at' => time(),
  15. ]);
  16. return $re;
  17. }
  18. }