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,42 +10,47 @@ 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();
$grid->model()->where('user_id', $user->id);
// 在 display 回调中使用
$grid->column('序号')->display(function () {
return $this->_index + 1;
});
$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 回调中使用
$grid->column('序号')->display(function () {
return $this->_index + 1;
});
// $grid->column('id')->sortable();
$grid->column('time', '结算时间');
$grid->column('num', '数量');
$grid->column('amount', '金额');
$grid->column('pay_img', '转账截图');
$grid->column('status', '状态')->display(function ($val) {
return TasksOrder::ORDER_STATUS_DESC[$val];
});
$grid->column('time', '结算时间');
$grid->column('num', '数量');
$grid->column('amount', '金额');
$grid->column('pay_img', '转账截图');
$grid->column('status', '状态')->display(function ($val) {
return TasksOrder::ORDER_STATUS_DESC[$val];
});
// $grid->column('created_at');
// $grid->column('updated_at')->sortable();
$grid->actions(function (Grid\Displayers\Actions $actions) use ($user) {
$actions->append(new OrderDetailAction());//
$grid->actions(function (Grid\Displayers\Actions $actions) use ($user) {
$actions->append(new OrderDetailAction());//
});
});
$grid->disableCreateButton()->disableDeleteButton()->disableEditButton()->disableViewButton();
$grid->filter(function (Grid\Filter $filter) {
$grid->disableCreateButton()->disableDeleteButton()->disableEditButton()->disableViewButton();
$grid->filter(function (Grid\Filter $filter) {
// $filter->equal('id');
});
});
});
}
}
}
......@@ -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,7 +143,8 @@ 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) {
return Grid::make(TasksApprove::with(['task', 'collects', 'user']), function (Grid $grid) {
$grid->model()->where('status', 0)->orderBy('task_id', 'desc');
// 在 display 回调中使用
......@@ -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,17 +23,23 @@ 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');
$grid->column('remark');
$grid->column('created_at');
$grid->column('updated_at')->sortable();
$grid->filter(function (Grid\Filter $filter) {
$filter->equal('id');
});
});
}
......@@ -81,7 +87,7 @@ class TasksCollectController extends AdminController
$form->text('net_img');
$form->text('is_find');
$form->text('remark');
$form->display('created_at');
$form->display('updated_at');
});
......
......@@ -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