Commit 66cebc84 by 汪伟伟

修改

parent 5a1e0464
......@@ -44,13 +44,27 @@ class AlreadyApproveController extends AdminController
// $grid->column('id')->sortable();
$grid->column('task.name', '指标名称');
$grid->column('task.city_id', '地区')->distpicker();
$grid->column('task.city_id', '地区')->display(function ($v){
return CityAreaService::getAreaName($v);
});
$grid->column('task.year', '时间');
$grid->column('task.refer', '参考信源');
$grid->column('task.refer', '参考信源')->display(function ($val) {
if (filter_var($val, FILTER_VALIDATE_URL) !== false) {//是链接
return "<a href={$val} target='_blank' style='color: #00b44e'>点击查看</a>";
}else{
return $val;
}
});
$grid->column('task.price', '单价');
$grid->column('collects.value', '指标值');
$grid->column('collects.reality_refer', '实际信源');
$grid->column('collects.reality_refer', '实际信源')->display(function ($val) {
if (filter_var($val, FILTER_VALIDATE_URL) !== false) {//是链接
return "<a href={$val} target='_blank' style='color: #00b44e'>点击查看</a>";
}else{
return $val;
}
});
$grid->column('collects.refer_level', '信源等级');
// $grid->column('collects.net_img', '截图链接');
$grid->column('status', '状态')->display(function ($statusValue) {//是当前字段的值
......
......@@ -4,6 +4,7 @@ namespace App\Admin\Controllers;
use App\Admin\Extensions\Tools\BackAction;
use App\Admin\Repositories\TasksReceive;
use App\Admin\Services\CityAreaService;
use App\Models\TasksApprove;
use App\Models\TasksCollect;
use Dcat\Admin\Actions\Action;
......@@ -44,15 +45,29 @@ class AlreadyDoneTaskController extends AdminController
// $grid->column('id')->sortable();
$grid->column('task.name', '指标名称');
$grid->column('task.city_id', '地区')->distpicker();
$grid->column('task.city_id', '地区')->display(function ($v){
return CityAreaService::getAreaName($v);
});
$grid->column('task.year', '时间');
$grid->column('task.refer', '参考信源');
$grid->column('task.refer', '参考信源')->display(function ($val) {
if (filter_var($val, FILTER_VALIDATE_URL) !== false) {//是链接
return "<a href={$val} target='_blank' style='color: #00b44e'>点击查看</a>";
}else{
return $val;
}
});
$grid->column('task.level', '等级');
$grid->column('task.price', '单价');
$grid->column('collects.value', '指标值');
$grid->column('collects.reality_refer', '实际信源');
$grid->column('collects.reality_refer', '实际信源')->display(function ($val) {
if (filter_var($val, FILTER_VALIDATE_URL) !== false) {//是链接
return "<a href={$val} target='_blank' style='color: #00b44e'>点击查看</a>";
}else{
return $val;
}
});
// $grid->column('collects.net_img', '网页截图');
$grid->column('status', '状态')->display(function ($val) {
......
......@@ -10,11 +10,16 @@ use Dcat\Admin\Http\Controllers\AdminController;
class AlreadySettlementController extends AdminController
{
protected $title = '已经结算任务';
protected $title = '已经结算' ;
protected function grid()
{
return Grid::make(TasksOrder::query(), function (Grid $grid) {
$user = Admin::user();
if ($user->is_admin == 1) {
return response()->redirectTo('/orders');
} else {
return Grid::make(TasksOrder::query(), function (Grid $grid) use ($user) {
$grid->model()->where('user_id', $user->id);
// 在 display 回调中使用
......@@ -47,5 +52,5 @@ class AlreadySettlementController extends AdminController
});
});
}
}
}
......@@ -6,6 +6,7 @@ use App\Admin\Extensions\Tools\CreateSettlementOrder;
use App\Admin\Extensions\Tools\ReturnBack;
use App\Admin\Extensions\Tools\UserConfirmOrder;
use App\Admin\Repositories\TasksReceive;
use App\Admin\Services\CityAreaService;
use App\Models\AdminUser;
use App\Models\TasksOrder;
use Dcat\Admin\Admin;
......@@ -37,13 +38,27 @@ class CreateOrderController extends AdminController
// $grid->column('id')->sortable();
$grid->column('task.name', '指标名称');
$grid->column('task.city_id', '地区')->distpicker();
$grid->column('task.city_id', '地区')->display(function ($v){
return CityAreaService::getAreaName($v);
});
$grid->column('task.year', '时间');
$grid->column('task.refer', '参考信源');
$grid->column('task.refer', '参考信源')->display(function ($val) {
if (filter_var($val, FILTER_VALIDATE_URL) !== false) {//是链接
return "<a href={$val} target='_blank' style='color: #00b44e'>点击查看</a>";
}else{
return $val;
}
});
$grid->column('task.price', '单价');
$grid->column('collects.value', '指标值');
$grid->column('collects.reality_refer', '实际信源');
$grid->column('collects.reality_refer', '实际信源')->display(function ($val) {
if (filter_var($val, FILTER_VALIDATE_URL) !== false) {//是链接
return "<a href={$val} target='_blank' style='color: #00b44e'>点击查看</a>";
}else{
return $val;
}
});
$grid->column('status', '状态')->display(function ($val) {
return \App\Models\TasksReceive::STATUS_DESC[$val];
......
......@@ -4,6 +4,7 @@ namespace App\Admin\Controllers;
use App\Admin\Extensions\Tools\BackAction;
use App\Admin\Repositories\TasksReceive;
use App\Admin\Services\CityAreaService;
use App\Models\TasksApprove;
use App\Models\TasksCollect;
use Dcat\Admin\Actions\Action;
......@@ -45,9 +46,17 @@ class NoDoneTaskController extends AdminController
// $grid->column('id')->sortable();
$grid->column('task.name', '指标名称');
$grid->column('task.city_id', '地区')->distpicker();
$grid->column('task.city_id', '地区')->display(function ($v){
return CityAreaService::getAreaName($v);
});
$grid->column('task.year', '时间');
$grid->column('task.refer', '参考信源');
$grid->column('task.refer', '参考信源')->display(function ($val) {
if (filter_var($val, FILTER_VALIDATE_URL) !== false) {//是链接
return "<a href={$val} target='_blank' style='color: #00b44e'>点击查看</a>";
}else{
return $val;
}
});
$grid->column('task.level', '等级');
......
......@@ -6,6 +6,7 @@ use App\Admin\Extensions\Tools\BatchReceiveAction;
use App\Admin\Extensions\Tools\CreateSettlementOrder;
use App\Admin\Extensions\Tools\ReceiveAction;
use App\Admin\Repositories\Task;
use App\Admin\Services\CityAreaService;
use App\Models\TasksReceive;
use Dcat\Admin\Admin;
use Dcat\Admin\Form;
......@@ -56,9 +57,17 @@ class TaskController extends AdminController
// $grid->column('id')->sortable();
$grid->column('name');
$grid->column('level');
$grid->column('city_id')->distpicker();
$grid->column('city_id')->display(function ($v){
return CityAreaService::getAreaName($v);
});
$grid->column('year');
$grid->column('refer');
$grid->column('refer')->display(function ($val) {
if (filter_var($val, FILTER_VALIDATE_URL) !== false) {//是链接
return "<a href={$val} target='_blank' style='color: #00b44e'>点击查看</a>";
}else{
return $val;
}
});
// $grid->column('guide');
// $grid->column('status');
// $grid->column('created_at');
......@@ -135,9 +144,18 @@ class TaskController extends AdminController
// $grid->column('id')->sortable();
$grid->column('name');
$grid->column('level');
$grid->column('city_id')->distpicker();
// $grid->column('city_id')->distpicker();
$grid->column('city_id')->display(function ($v){
return CityAreaService::getAreaName($v);
});
$grid->column('year');
$grid->column('refer');
$grid->column('refer')->display(function ($val) {
if (filter_var($val, FILTER_VALIDATE_URL) !== false) {//是链接
return "<a href={$val} target='_blank' style='color: #00b44e'>点击查看</a>";
}else{
return $val;
}
});
// $grid->column('guide');
// $grid->column('status');
// $grid->column('created_at');
......
......@@ -5,6 +5,7 @@ namespace App\Admin\Controllers;
use App\Admin\Extensions\Tools\BackAction;
use App\Admin\Extensions\Tools\OrderDetailAction;
use App\Admin\Repositories\TasksReceive;
use App\Admin\Services\CityAreaService;
use App\Models\TasksApprove;
use App\Models\TasksCollect;
use App\Models\TasksOrder;
......@@ -101,16 +102,30 @@ class TaskReceiveController extends AdminController
// $grid->column('id')->sortable();
$grid->column('task.name', '指标名称');
$grid->column('task.city_id', '地区')->distpicker();
$grid->column('task.city_id', '地区')->display(function ($v){
return CityAreaService::getAreaName($v);
});
$grid->column('task.year', '时间');
$grid->column('task.refer', '参考信源');
$grid->column('task.refer', '参考信源')->display(function ($val) {
if (filter_var($val, FILTER_VALIDATE_URL) !== false) {//是链接
return "<a href={$val} target='_blank' style='color: #00b44e'>点击查看</a>";
}else{
return $val;
}
});
$grid->column('task.level', '等级');
if ($status == 1) {
$grid->column('task.price', '单价');
$grid->column('collects.value', '指标值');
$grid->column('collects.reality_refer', '实际信源');
$grid->column('collects.reality_refer', '实际信源')->display(function ($val) {
if (filter_var($val, FILTER_VALIDATE_URL) !== false) {//是链接
return "<a href={$val} target='_blank' style='color: #00b44e'>点击查看</a>";
}else{
return $val;
}
});
// $grid->column('collects.net_img', '网页截图');
}
......
......@@ -22,13 +22,13 @@ use SuperEggs\DcatDistpicker\DcatDistpickerHelper;
class TasksApproveController extends AdminController
{
protected $title='未审核';
protected $title = '未审核';
public function checkData($status)
{
$content = Content::make();
return $content->body(view('admin.check',['id'=>1]));
return $content->body(view('admin.check', ['id' => 1]));
}
protected function getData22($status)
......@@ -50,9 +50,17 @@ class TasksApproveController extends AdminController
// $grid->column('id')->sortable();
$grid->column('name', '指标名称');
$grid->column('city_id', '地区')->distpicker();
$grid->column('city_id', '地区')->display(function ($v) {
return CityAreaService::getAreaName($v);
});
$grid->column('year', '时间');
$grid->column('refer', '参考信源');
$grid->column('refer', '参考信源')->display(function ($val) {
if (filter_var($val, FILTER_VALIDATE_URL) !== false) {//是链接
return "<a href={$val} target='_blank' style='color: #00b44e'>点击查看</a>";
}else{
return $val;
}
});
$grid->column('price', '单价');
$grid->disableEditButton()->disableDeleteButton()->disableCreateButton()->disableFilterButton()->disableBatchDelete();
......@@ -76,7 +84,13 @@ class TasksApproveController extends AdminController
$grid->column('collects.value', '指标值');
$grid->column('collects.reality_refer', '实际信源');
$grid->column('collects.reality_refer', '实际信源')->display(function ($val) {
if (filter_var($val, FILTER_VALIDATE_URL) !== false) {//是链接
return "<a href={$val} target='_blank' style='color: #00b44e'>点击查看</a>";
}else{
return $val;
}
});
$grid->column('collects.refer_level', '信源等级');
// $grid->column('collects.net_img', '截图链接');
......@@ -93,7 +107,7 @@ class TasksApproveController extends AdminController
$content = Content::make();
$row = new Row();
$row->column(12, function (Column $column) use ($header){
$row->column(12, function (Column $column) use ($header) {
$column->row(
$header
......@@ -129,6 +143,7 @@ class TasksApproveController extends AdminController
// $model = \App\Models\Task::query()->with(['approves'])->whereIn('id',$taskIds);
// dd($taskIds);
return Grid::make(TasksApprove::with(['task', 'collects', 'user']), function (Grid $grid) {
$grid->model()->where('status', 0)->orderBy('task_id', 'desc');
......@@ -140,13 +155,27 @@ class TasksApproveController extends AdminController
// $grid->column('id')->sortable();
$grid->column('task.name', '指标名称');
$grid->column('task.city_id', '地区')->distpicker();
$grid->column('task.city_id', '地区')->display(function ($v) {
return CityAreaService::getAreaName($v);
});
$grid->column('task.year', '时间');
$grid->column('task.refer', '参考信源');
$grid->column('task.refer', '参考信源')->display(function ($val) {
if (filter_var($val, FILTER_VALIDATE_URL) !== false) {//是链接
return "<a href={$val} target='_blank' style='color: #00b44e'>点击查看</a>";
}else{
return $val;
}
});
$grid->column('task.price', '单价');
$grid->column('collects.value', '指标值');
$grid->column('collects.reality_refer', '实际信源');
$grid->column('collects.reality_refer', '实际信源')->display(function ($val) {
if (filter_var($val, FILTER_VALIDATE_URL) !== false) {//是链接
return "<a href={$val} target='_blank' style='color: #00b44e'>点击查看</a>";
}else{
return $val;
}
});
$grid->column('collects.refer_level', '信源等级');
// $grid->column('collects.net_img', '截图链接');
......
......@@ -23,7 +23,13 @@ class TasksCollectController extends AdminController
$grid->column('user_id');
$grid->column('receive_id');
$grid->column('value');
$grid->column('reality_refer');
$grid->column('reality_refer')->display(function ($val) {
if (filter_var($val, FILTER_VALIDATE_URL) !== false) {//是链接
return "<a href={$val} target='_blank' style='color: #00b44e'>点击查看</a>";
}else{
return $val;
}
});
$grid->column('refer_level');
$grid->column('net_img');
$grid->column('is_find');
......
......@@ -6,6 +6,7 @@ use App\Admin\Extensions\Tools\CreateSettlementOrder;
use App\Admin\Extensions\Tools\ReturnBack;
use App\Admin\Extensions\Tools\UserConfirmOrder;
use App\Admin\Repositories\TasksReceive;
use App\Admin\Services\CityAreaService;
use App\Models\AdminUser;
use App\Models\TasksOrder;
use Dcat\Admin\Admin;
......@@ -66,15 +67,29 @@ class TasksOrderController extends AdminController
// $grid->column('id')->sortable();
$grid->column('task.name', '指标名称');
$grid->column('task.city_id', '地区')->distpicker();
$grid->column('task.city_id', '地区')->display(function ($v){
return CityAreaService::getAreaName($v);
});
$grid->column('task.year', '时间');
$grid->column('task.refer', '参考信源');
$grid->column('task.refer', '参考信源')->display(function ($val) {
if (filter_var($val, FILTER_VALIDATE_URL) !== false) {//是链接
return "<a href={$val} target='_blank' style='color: #00b44e'>点击查看</a>";
}else{
return $val;
}
});
$grid->column('task.level', '等级');
$grid->column('task.price', '单价');
$grid->column('collects.value', '指标值');
$grid->column('collects.reality_refer', '实际信源');
$grid->column('collects.reality_refer', '实际信源')->display(function ($val) {
if (filter_var($val, FILTER_VALIDATE_URL) !== false) {//是链接
return "<a href={$val} target='_blank' style='color: #00b44e'>点击查看</a>";
}else{
return $val;
}
});
// $grid->column('collects.net_img', '网页截图');
......@@ -116,6 +131,7 @@ class TasksOrderController extends AdminController
});
}
protected $title='结算';
/**
* Make a grid builder.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment