Browse Source
Merge branch 'qs_local_master_9_23'
Merge branch 'qs_local_master_9_23'
# Conflicts: # app/Models/ImsCjdcOrderMain.phpmaster
4 changed files with 81 additions and 18 deletions
-
42app/Admin/Actions/Tools/ShowOrderStateHandle.php
-
6app/Admin/Controllers/ImsCjdcOrderMainController.php
-
4app/Admin/Forms/RefundNote.php
-
43app/Models/ImsCjdcOrderMain.php
@ -0,0 +1,42 @@ |
|||||
|
<?php |
||||
|
namespace App\Admin\Actions\Tools; |
||||
|
|
||||
|
use App\Admin\Common\Auth; |
||||
|
use App\Models\ImsCjdcOrderMain; |
||||
|
use Dcat\Admin\Admin; |
||||
|
use Dcat\Admin\Grid\Tools\AbstractTool; |
||||
|
|
||||
|
class ShowOrderStateHandle extends AbstractTool |
||||
|
{ |
||||
|
protected $state; |
||||
|
public function __construct($state=null) |
||||
|
{ |
||||
|
$this->state = $state; |
||||
|
parent::__construct($title=null); |
||||
|
} |
||||
|
|
||||
|
protected function script() |
||||
|
{ |
||||
|
$url = "order?state=".$this->state; |
||||
|
return <<<JS |
||||
|
$(".order_state_{$this->state}").on('click',function () { |
||||
|
window.location.href = "{$url}" |
||||
|
}); |
||||
|
JS; |
||||
|
} |
||||
|
|
||||
|
public function render() |
||||
|
{ |
||||
|
$title = ''; |
||||
|
$count = ImsCjdcOrderMain::getOrderStateCount($this->state,Auth::getMarket()); |
||||
|
if ($this->state==8){ |
||||
|
$title = "退款申请(".$count.")"; |
||||
|
}elseif ($this->state==2){ |
||||
|
$title = "待接单(".$count.")"; |
||||
|
} |
||||
|
Admin::script($this->script()); |
||||
|
return "<a class=\"btn btn-primary order_state_{$this->state}\">{$title}</a>"; |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue