You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
<?phpnamespace 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() { if ($this->state){ $url = "order?state=".$this->state.'&'."time=".(time()-(7*86400)); }else{ $url = "order"; } return <<<JS$(".order_state_{$this->state}").on('click',function () { window.location.href = "{$url}"});JS; }
public function render() { $title = '<i class="feather icon-rotate-ccw"></i> 重置'; $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>"; }
}
|