parent
b936054f2d
commit
9b483c2c8a
@ -0,0 +1,14 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
|
||||||
|
use Illuminate\Support\Facades\Cache;
|
||||||
|
|
||||||
|
class Message extends SoftDeletesModel
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@ -0,0 +1,18 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
|
||||||
|
use Illuminate\Support\Facades\Cache;
|
||||||
|
|
||||||
|
class SupplyDemand extends SoftDeletesModel
|
||||||
|
{
|
||||||
|
|
||||||
|
public function user()
|
||||||
|
{
|
||||||
|
return $this->hasOne(User::class, 'id', 'user_id');
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@ -0,0 +1,49 @@
|
|||||||
|
<?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('supply_demands', function (Blueprint $table) {
|
||||||
|
$table->comment('需求供应表');
|
||||||
|
$table->id();
|
||||||
|
// 用户id
|
||||||
|
$table->integer('user_id')->nullable()->comment('用户id');
|
||||||
|
$table->string('title')->nullable()->comment('标题');
|
||||||
|
// 分类
|
||||||
|
$table->integer('type')->nullable()->comment('分类1供应2需求');
|
||||||
|
// 内容
|
||||||
|
$table->text('content')->nullable()->comment('内容');
|
||||||
|
// 标签
|
||||||
|
$table->string('tag')->nullable()->comment('标签');
|
||||||
|
// 微信号
|
||||||
|
$table->string('wechat')->nullable()->comment('微信号');
|
||||||
|
// 电话
|
||||||
|
$table->string('mobile')->nullable()->comment('电话');
|
||||||
|
// 邮箱
|
||||||
|
$table->string('email')->nullable()->comment('邮箱');
|
||||||
|
// 审核状态
|
||||||
|
$table->tinyInteger('status')->default(0)->comment('状态0待审核1通过2拒绝');
|
||||||
|
$table->timestamps();
|
||||||
|
$table->softDeletes();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('supply_demand_types');
|
||||||
|
}
|
||||||
|
};
|
||||||
@ -0,0 +1,42 @@
|
|||||||
|
<?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('messages', function (Blueprint $table) {
|
||||||
|
$table->comment('消息表');
|
||||||
|
$table->id();
|
||||||
|
// 用户id
|
||||||
|
$table->integer('user_id')->nullable()->comment('用户id');
|
||||||
|
// 接收人id
|
||||||
|
$table->integer('to_user_id')->nullable()->comment('接收人id');
|
||||||
|
// 需求id
|
||||||
|
$table->integer('supply_demand_id')->nullable()->comment('需求id');
|
||||||
|
// 消息内容
|
||||||
|
$table->text('content')->nullable()->comment('消息内容');
|
||||||
|
// 接收方是否已读
|
||||||
|
$table->tinyInteger('is_read')->nullable()->default(0)->comment('接收方是否已读0否1是');
|
||||||
|
$table->timestamps();
|
||||||
|
$table->softDeletes();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('massages');
|
||||||
|
}
|
||||||
|
};
|
||||||
Loading…
Reference in new issue