Edit / PDF / Mail / ->Leads
This commit is contained in:
parent
5d55e5be3f
commit
66ca252bfa
43 changed files with 2915 additions and 76 deletions
|
|
@ -0,0 +1,77 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateLeadMailsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('lead_mails', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
|
||||
$table->bigInteger('lead_id');
|
||||
$table->bigInteger('customer_id');
|
||||
|
||||
$table->boolean('is_answer')->default(false);
|
||||
$table->unsignedBigInteger('reply_id');
|
||||
|
||||
$table->string('email', 255);
|
||||
|
||||
$table->text('recipient')->nullable();
|
||||
$table->text('cc')->nullable();
|
||||
$table->text('bcc')->nullable();
|
||||
|
||||
$table->string('subject', 255);
|
||||
$table->text('message')->nullable();
|
||||
|
||||
$table->unsignedTinyInteger('dir')->default(0);
|
||||
$table->bigInteger('subdir')->nullable();
|
||||
|
||||
$table->boolean('draft')->default(false);
|
||||
$table->boolean('important')->default(false);
|
||||
|
||||
$table->boolean('send')->default(false);
|
||||
$table->boolean('fail')->default(false);
|
||||
$table->text('error')->nullable();
|
||||
$table->text('forward')->nullable();
|
||||
|
||||
$table->timestamp('sent_at')->nullable();
|
||||
$table->timestamp('scheduled_at')->nullable();
|
||||
$table->timestamp('delivered_at')->nullable();
|
||||
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('customer_id')
|
||||
->references('id')
|
||||
->on('customer')
|
||||
->onDelete('CASCADE');
|
||||
|
||||
$table->foreign('lead_id')
|
||||
->references('id')
|
||||
->on('lead')
|
||||
->onDelete('CASCADE');
|
||||
|
||||
$table->foreign('reply_id')
|
||||
->references('id')
|
||||
->on('customer_mails')
|
||||
->onDelete('CASCADE');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('lead_mails');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,53 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateLeadFilesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('lead_files', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
|
||||
$table->bigInteger('lead_id');
|
||||
$table->unsignedBigInteger('lead_mail_id')->nullable();
|
||||
|
||||
$table->string('identifier')->index();
|
||||
$table->string('filename');
|
||||
$table->string('dir');
|
||||
$table->string('original_name');
|
||||
$table->string('ext');
|
||||
$table->string('mine');
|
||||
$table->unsignedInteger('size');
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('lead_id')
|
||||
->references('id')
|
||||
->on('lead')
|
||||
->onDelete('CASCADE');
|
||||
|
||||
$table->foreign('lead_mail_id')
|
||||
->references('id')
|
||||
->on('lead_mails')
|
||||
->onDelete('CASCADE');
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('lead_files');
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateLeadNoticesTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('lead_notices', function (Blueprint $table) {
|
||||
$table->bigIncrements('id');
|
||||
$table->bigInteger('lead_id');
|
||||
//from
|
||||
$table->unsignedInteger('from_user_id');
|
||||
//to
|
||||
$table->unsignedInteger('to_user_id')->nullable();
|
||||
|
||||
$table->text('message')->nullable();
|
||||
$table->boolean('show')->default(false);
|
||||
$table->boolean('important')->default(false);
|
||||
|
||||
$table->timestamp('edit_at')->nullable();
|
||||
|
||||
$table->timestamps();
|
||||
|
||||
$table->foreign('lead_id')
|
||||
->references('id')
|
||||
->on('lead')
|
||||
->onDelete('CASCADE');
|
||||
|
||||
$table->foreign('from_user_id')
|
||||
->references('id')
|
||||
->on('users')
|
||||
->onDelete('CASCADE');
|
||||
|
||||
$table->foreign('to_user_id')
|
||||
->references('id')
|
||||
->on('users')
|
||||
->onDelete('CASCADE');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('lead_notices');
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue