28 lines
602 B
PHP
28 lines
602 B
PHP
<?php
|
|
|
|
namespace App\Admin\Actions\Store;
|
|
|
|
use Dcat\Admin\Grid\RowAction;
|
|
use App\Models\Store\Desk;
|
|
|
|
class RowDeskWxCode extends RowAction
|
|
{
|
|
protected $title = '生成小程序码';
|
|
|
|
public function handle()
|
|
{
|
|
$model = Desk::findOrFail($this->getKey());
|
|
$result = $model->generateWxCode();
|
|
if ($result !== true) {
|
|
return $this->response()->error(data_get($result, 'errmsg'))->refresh();
|
|
}
|
|
return $this->response()->success('操作成功')->refresh();
|
|
}
|
|
|
|
public function confirm()
|
|
{
|
|
return ['是否确定?'];
|
|
}
|
|
}
|
|
|