Browse Source

修复头像

develop
shuixiang 4 years ago
parent
commit
0b065a35e8
  1. 4
      app/AdminAgent/Controllers/WorkorderController.php
  2. 4
      app/AdminGuide/Controllers/WorkorderController.php
  3. 4
      app/AdminSupplier/Controllers/WorkorderController.php
  4. 5
      app/Models/Agent.php
  5. 5
      app/Models/Guide.php
  6. 5
      app/Models/Supplier.php
  7. 40
      database/migrations/2021_09_10_144727_update_workorder_table.php

4
app/AdminAgent/Controllers/WorkorderController.php

@ -46,7 +46,7 @@ class WorkorderController extends AdminController
$arr = [ $arr = [
'workorder_id' => $v->id, 'workorder_id' => $v->id,
'unread' => true, 'unread' => true,
'avatar' => $v->publisher_type == DemandTraits::$col[0] ? $v->point->avatar : $v->publisher->avatar,
'avatar' => Storage::url($v->publisher_type == DemandTraits::$col[0] ? $v->point->avatar : $v->publisher->avatar),
'name' => $v->publisher_type == DemandTraits::$col[0] ? $v->point->name : $v->publisher->name, 'name' => $v->publisher_type == DemandTraits::$col[0] ? $v->point->name : $v->publisher->name,
'content' => $v->title, 'content' => $v->title,
'last_message' => $item ? ($item->type == 1 ? $item->content : '【 图片 】') : '', 'last_message' => $item ? ($item->type == 1 ? $item->content : '【 图片 】') : '',
@ -64,7 +64,7 @@ class WorkorderController extends AdminController
$arr = [ $arr = [
'type' => $v->publisher_type == DemandTraits::$col[0] ? 'my' : 'op', 'type' => $v->publisher_type == DemandTraits::$col[0] ? 'my' : 'op',
'it_type' => $v->type, 'it_type' => $v->type,
'avatar' => $v->publisher->avatar,
'avatar' => Storage::url($v->publisher->avatar),
'name' => $v->publisher->name, 'name' => $v->publisher->name,
'content' => $v->content, 'content' => $v->content,
'created_at_text' => $v->created_at, 'created_at_text' => $v->created_at,

4
app/AdminGuide/Controllers/WorkorderController.php

@ -46,7 +46,7 @@ class WorkorderController extends AdminController
$arr = [ $arr = [
'workorder_id' => $v->id, 'workorder_id' => $v->id,
'unread' => true, 'unread' => true,
'avatar' => $v->publisher_type == DemandTraits::$col[2] ? $v->point->avatar : $v->publisher->avatar,
'avatar' => Storage::url($v->publisher_type == DemandTraits::$col[2] ? $v->point->avatar : $v->publisher->avatar),
'name' => $v->publisher_type == DemandTraits::$col[2] ? $v->point->name : $v->publisher->name, 'name' => $v->publisher_type == DemandTraits::$col[2] ? $v->point->name : $v->publisher->name,
'content' => $v->title, 'content' => $v->title,
'last_message' => $item ? ($item->type == 1 ? $item->content : '【 图片 】') : '', 'last_message' => $item ? ($item->type == 1 ? $item->content : '【 图片 】') : '',
@ -64,7 +64,7 @@ class WorkorderController extends AdminController
$arr = [ $arr = [
'type' => $v->publisher_type == DemandTraits::$col[2] ? 'my' : 'op', 'type' => $v->publisher_type == DemandTraits::$col[2] ? 'my' : 'op',
'it_type' => $v->type, 'it_type' => $v->type,
'avatar' => $v->publisher->avatar,
'avatar' => Storage::url($v->publisher->avatar),
'name' => $v->publisher->name, 'name' => $v->publisher->name,
'content' => $v->content, 'content' => $v->content,
'created_at_text' => $v->created_at, 'created_at_text' => $v->created_at,

4
app/AdminSupplier/Controllers/WorkorderController.php

@ -46,7 +46,7 @@ class WorkorderController extends AdminController
$arr = [ $arr = [
'workorder_id' => $v->id, 'workorder_id' => $v->id,
'unread' => true, 'unread' => true,
'avatar' => $v->publisher_type == DemandTraits::$col[1] ? $v->point->avatar : $v->publisher->avatar,
'avatar' => Storage::url($v->publisher_type == DemandTraits::$col[1] ? $v->point->avatar : $v->publisher->avatar),
'name' => $v->publisher_type == DemandTraits::$col[1] ? $v->point->name : $v->publisher->name, 'name' => $v->publisher_type == DemandTraits::$col[1] ? $v->point->name : $v->publisher->name,
'content' => $v->title, 'content' => $v->title,
'last_message' => $item ? ($item->type == 1 ? $item->content : '【 图片 】') : '', 'last_message' => $item ? ($item->type == 1 ? $item->content : '【 图片 】') : '',
@ -64,7 +64,7 @@ class WorkorderController extends AdminController
$arr = [ $arr = [
'type' => $v->publisher_type == DemandTraits::$col[1] ? 'my' : 'op', 'type' => $v->publisher_type == DemandTraits::$col[1] ? 'my' : 'op',
'it_type' => $v->type, 'it_type' => $v->type,
'avatar' => $v->publisher->avatar,
'avatar' => Storage::url($v->publisher->avatar),
'name' => $v->publisher->name, 'name' => $v->publisher->name,
'content' => $v->content, 'content' => $v->content,
'created_at_text' => $v->created_at, 'created_at_text' => $v->created_at,

5
app/Models/Agent.php

@ -43,4 +43,9 @@ class Agent extends BaseModel
{ {
return $this->morphOne('App\Models\DemandBidding', 'biddingUser'); return $this->morphOne('App\Models\DemandBidding', 'biddingUser');
} }
public function workoorderitem()
{
return $this->morphOne('App\Models\WorkorderItem', 'publisher');
}
} }

5
app/Models/Guide.php

@ -31,4 +31,9 @@ class Guide extends BaseModel
{ {
return $this->morphOne('App\Models\DemandBidding', 'biddingUser'); return $this->morphOne('App\Models\DemandBidding', 'biddingUser');
} }
public function workoorderitem()
{
return $this->morphOne('App\Models\WorkorderItem', 'publisher');
}
} }

5
app/Models/Supplier.php

@ -48,4 +48,9 @@ class Supplier extends BaseModel
{ {
return $this->morphOne('App\Models\Workorder', 'point'); return $this->morphOne('App\Models\Workorder', 'point');
} }
public function workoorderitem()
{
return $this->morphOne('App\Models\WorkorderItem', 'publisher');
}
} }

40
database/migrations/2021_09_10_144727_update_workorder_table.php

@ -0,0 +1,40 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class UpdateWorkorderTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('workorder', function (Blueprint $table) {
$table->text('content')->nullable()->change();
});
Schema::table('workorder_item', function (Blueprint $table) {
$table->text('content')->nullable()->change();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('workorder', function (Blueprint $table) {
$table->string('content')->change();
});
Schema::table('workorder_item', function (Blueprint $table) {
$table->string('content')->change();
});
}
}
Loading…
Cancel
Save