|
|
@ -17,6 +17,7 @@ use App\Admin\Repositories\ImsCjdcOrderMain; |
|
|
use App\Libs\SsdbClient; |
|
|
use App\Libs\SsdbClient; |
|
|
use App\Models\ImsCjdcMarket; |
|
|
use App\Models\ImsCjdcMarket; |
|
|
use App\Models\LanzuStore; |
|
|
use App\Models\LanzuStore; |
|
|
|
|
|
use App\Models\v3\LanzuEmployees; |
|
|
use Dcat\Admin\Admin; |
|
|
use Dcat\Admin\Admin; |
|
|
use Dcat\Admin\Form; |
|
|
use Dcat\Admin\Form; |
|
|
use Dcat\Admin\Grid; |
|
|
use Dcat\Admin\Grid; |
|
|
@ -70,12 +71,30 @@ class ImsCjdcOrderMainController extends AdminController |
|
|
return date('Y-m-d H:i:s',$time); |
|
|
return date('Y-m-d H:i:s',$time); |
|
|
} |
|
|
} |
|
|
return '<span style="color: #ceccce">未支付</span>'; |
|
|
return '<span style="color: #ceccce">未支付</span>'; |
|
|
}); |
|
|
|
|
|
|
|
|
})->width(100); |
|
|
$grid->column('shipping_type', '配送方式') |
|
|
$grid->column('shipping_type', '配送方式') |
|
|
->using(config('order.shipping_type')) |
|
|
->using(config('order.shipping_type')) |
|
|
->label([1 => '#FF9900', 2 => '#99CCFF', 3 => '#CCCCCC']); |
|
|
->label([1 => '#FF9900', 2 => '#99CCFF', 3 => '#CCCCCC']); |
|
|
$grid->created_at('下单时间')->display(function ($time) { |
|
|
$grid->created_at('下单时间')->display(function ($time) { |
|
|
return date('Y-m-d H:i:s',$time); |
|
|
return date('Y-m-d H:i:s',$time); |
|
|
|
|
|
})->width(100); |
|
|
|
|
|
Admin::script(<<<JS |
|
|
|
|
|
$('.grid-column-copyable').off('click').on('click', function (e) { |
|
|
|
|
|
let content = $(this).data('content'); |
|
|
|
|
|
let temp = $('<input>'); |
|
|
|
|
|
|
|
|
|
|
|
$("body").append(temp); |
|
|
|
|
|
temp.val(content).select(); |
|
|
|
|
|
document.execCommand("copy"); |
|
|
|
|
|
temp.remove(); |
|
|
|
|
|
|
|
|
|
|
|
$(this).tooltip('show'); |
|
|
|
|
|
}); |
|
|
|
|
|
JS); |
|
|
|
|
|
$grid->column('骑手')->display(function () { |
|
|
|
|
|
//模型关联不起作用,暂时先不查找原因
|
|
|
|
|
|
$employees = LanzuEmployees::find($this->horseman_id); |
|
|
|
|
|
return ($this->shipping_name ?? '') . '<br>' . ($employees->tel ?? ''); |
|
|
}); |
|
|
}); |
|
|
$grid->actions(function (Grid\Displayers\Actions $actions) use ($grid) { |
|
|
$grid->actions(function (Grid\Displayers\Actions $actions) use ($grid) { |
|
|
$state = $actions->row->state; |
|
|
$state = $actions->row->state; |
|
|
@ -95,6 +114,8 @@ class ImsCjdcOrderMainController extends AdminController |
|
|
$actions->append(new CheckRow($actions->row->id, $grid->model()->getCurrentPage(), '<div type="button" class="btn btn-outline-info btn-sm">配送</div>')); |
|
|
$actions->append(new CheckRow($actions->row->id, $grid->model()->getCurrentPage(), '<div type="button" class="btn btn-outline-info btn-sm">配送</div>')); |
|
|
$actions->append(new OrderStateHandle('<div type="button" class="btn btn-outline-warning btn-sm">取消接单</div>', 2)); |
|
|
$actions->append(new OrderStateHandle('<div type="button" class="btn btn-outline-warning btn-sm">取消接单</div>', 2)); |
|
|
} |
|
|
} |
|
|
|
|
|
$url = config('app.url') . '/grab.html#order&id=837023'; |
|
|
|
|
|
$actions->append('<div type="button" class="btn btn-sm grid-column-copyable" data-original-title="复制成功" data-content="'.$url.'">复制</div>'); |
|
|
} elseif ($state == 8) { |
|
|
} elseif ($state == 8) { |
|
|
$actions->append(new OrderStateHandle('<div type="button" class="btn btn-outline-secondary btn-sm">同意</div>', 9)); |
|
|
$actions->append(new OrderStateHandle('<div type="button" class="btn btn-outline-secondary btn-sm">同意</div>', 9)); |
|
|
$actions->append(new OrderRefund($actions->row->id, $grid->model()->getCurrentPage(), '<div type="button" class="btn btn-outline-secondary btn-sm">拒绝</div>')); |
|
|
$actions->append(new OrderRefund($actions->row->id, $grid->model()->getCurrentPage(), '<div type="button" class="btn btn-outline-secondary btn-sm">拒绝</div>')); |
|
|
|