6 changed files with 67 additions and 127 deletions
-
35app/Admin/Controllers/ImsCjdcOrderMainController.php
-
51app/Admin/Extensions/CheckRow.php
-
1app/Admin/Extensions/OrderPrint.php
-
16app/Admin/Extensions/OrderStateHandle.php
-
2app/Libs/feier_print/api_php_demo.php
-
89composer.lock
@ -1,59 +1,32 @@ |
|||
<?php |
|||
namespace App\Admin\Extensions; |
|||
|
|||
use App\Admin\Forms\CouponTieForm; |
|||
use App\Models\ImsCjdcOrderMain; |
|||
use App\Models\StoreAccount; |
|||
use Dcat\Admin\Grid\RowAction; |
|||
use Dcat\Admin\Widgets\Modal; |
|||
use Illuminate\Http\Request; |
|||
|
|||
class CheckRow extends RowAction |
|||
{ |
|||
|
|||
protected $model; |
|||
protected $state; |
|||
protected $title; |
|||
public function __construct($title=null,$state=null) |
|||
public function __construct($title=null) |
|||
{ |
|||
|
|||
parent::__construct($title); |
|||
$this->state = $state; |
|||
|
|||
} |
|||
|
|||
|
|||
/** |
|||
* 处理请求 |
|||
* |
|||
* @param Request $request |
|||
* |
|||
* @return \Dcat\Admin\Actions\Response |
|||
*/ |
|||
public function handle(Request $request) |
|||
{ |
|||
// 获取当前行ID
|
|||
$id = $this->getKey(); |
|||
$orderMain = new ImsCjdcOrderMain(); |
|||
$state = $request->get('state'); |
|||
$res = $orderMain->modifyState($id,$state); |
|||
if ($res==true){ |
|||
return $this->response()->success('操作成功')->refresh(); |
|||
}else{ |
|||
return $this->response()->error('操作失败'); |
|||
} |
|||
|
|||
|
|||
|
|||
} |
|||
|
|||
/** |
|||
* 设置要POST到接口的数据 |
|||
* |
|||
* @return array |
|||
*/ |
|||
public function parameters() |
|||
public function render() |
|||
{ |
|||
return [ |
|||
'state' => $this->state, |
|||
]; |
|||
// 实例化表单类并传递自定义参数
|
|||
$form = CouponTieForm::make(); |
|||
|
|||
return Modal::make() |
|||
->lg() |
|||
->title($this->title) |
|||
->body($form) |
|||
->button($this->title); |
|||
} |
|||
} |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue