diff --git a/app/Models/Node.php b/app/Models/Node.php index 2946208b..849c1426 100644 --- a/app/Models/Node.php +++ b/app/Models/Node.php @@ -3,9 +3,16 @@ namespace App\Models; use Illuminate\Database\Eloquent\Model; +use Illuminate\Support\Arr; class Node extends Model { protected $table = 'node'; protected $guarded = ['id']; + protected $appends = ['type_name']; + + public function getTypeNameAttribute() + { + return $this->attributes['type_name'] = Arr::get(config('freeswitch.node_type'),$this->type,'-'); + } } diff --git a/config/freeswitch.php b/config/freeswitch.php index 25645564..f5a92bfa 100644 --- a/config/freeswitch.php +++ b/config/freeswitch.php @@ -46,6 +46,12 @@ return [ 'host' => '192.168.254.216', 'wss_url' => 'testcall.shupian.cn', + 'node_type' => [ + 0 => '公共节点', + 1 => '客户跟进', + 2 => '订单生产', + 3 => '财务付款', + ], //队列响铃模式 'strategy' => [ diff --git a/database/migrations/2021_03_19_164406_node.php b/database/migrations/2021_03_19_164406_node.php index 8166479c..04145e71 100644 --- a/database/migrations/2021_03_19_164406_node.php +++ b/database/migrations/2021_03_19_164406_node.php @@ -17,7 +17,7 @@ class Node extends Migration $table->bigIncrements('id'); $table->string('name')->comment('节点名称'); $table->tinyInteger('sort')->default(10)->comment('排序'); - $table->tinyInteger('type')->default(1)->comment('1客户跟进,2订单生产,3财务付款'); + $table->tinyInteger('type')->default(0)->comment('默认0,0表示公共,1客户跟进,2订单生产,3财务付款'); $table->timestamps(); }); } diff --git a/resources/views/call/cdr/index.blade.php b/resources/views/call/cdr/index.blade.php index b4115a33..a0ea06d9 100644 --- a/resources/views/call/cdr/index.blade.php +++ b/resources/views/call/cdr/index.blade.php @@ -4,7 +4,7 @@