parent
599d522b9e
commit
2b0d36971a
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
class CompanyDetailCache extends SoftDeletesModel
|
||||
{
|
||||
|
||||
protected $casts = [
|
||||
'payload' => 'array',
|
||||
'fetched_at' => 'datetime',
|
||||
'last_matched_at' => 'datetime',
|
||||
];
|
||||
}
|
||||
@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('company_detail_caches', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('query_company_name')->comment('前端查询公司名称');
|
||||
$table->string('normalized_company_name')->unique()->comment('标准化查询公司名称');
|
||||
$table->string('enterprise_name')->nullable()->comment('第三方返回企业名称');
|
||||
$table->string('normalized_enterprise_name')->nullable()->index()->comment('标准化企业名称');
|
||||
$table->string('credit_code')->nullable()->index()->comment('统一社会信用代码');
|
||||
$table->string('enterprise_id')->nullable()->index()->comment('企业ID');
|
||||
$table->json('payload')->comment('第三方公司详情暂存数据');
|
||||
$table->dateTime('fetched_at')->nullable()->comment('抓取时间');
|
||||
$table->dateTime('last_matched_at')->nullable()->comment('最近匹配使用时间');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('company_detail_caches');
|
||||
}
|
||||
};
|
||||
Loading…
Reference in new issue