|
|
|
@ -165,8 +165,7 @@ class Server extends Controller |
|
|
|
|
*/ |
|
|
|
|
public function deleteServer(array $serverId): Json |
|
|
|
|
{ |
|
|
|
|
$model = new ServerModel; |
|
|
|
|
if ($model->remove($serverId)) { |
|
|
|
|
if (ServerModel::destroy($serverId)) { |
|
|
|
|
return $this->renderSuccess('删除成功'); |
|
|
|
|
} |
|
|
|
|
return $this->renderError('删除失败'); |
|
|
|
@ -235,6 +234,22 @@ class Server extends Controller |
|
|
|
|
return $this->renderSuccess($data); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @notes:订单详情 |
|
|
|
|
* @return Json |
|
|
|
|
* @author: wanghousheng |
|
|
|
|
*/ |
|
|
|
|
public function orderDetail(): Json |
|
|
|
|
{ |
|
|
|
|
$orderId = intval($this->request->post('orderId')); |
|
|
|
|
$data = \app\common\model\server\Order::detail(['order_id' => $orderId], ['user', 'dealer', 'image']); |
|
|
|
|
$data['server_info'] = null; |
|
|
|
|
if (!empty($data['server_id'])) { |
|
|
|
|
$data['server_info'] = ServerModel::detail($data['server_id'], ['category']); |
|
|
|
|
} |
|
|
|
|
return $this->renderSuccess(['detail' => $data]); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @notes:订单状态 |
|
|
|
|
* @return Json |
|
|
|
@ -297,7 +312,8 @@ class Server extends Controller |
|
|
|
|
/** |
|
|
|
|
* 服务配置 |
|
|
|
|
*/ |
|
|
|
|
public function configList() { |
|
|
|
|
public function configList() |
|
|
|
|
{ |
|
|
|
|
$model = new StoreServerConfig(); |
|
|
|
|
$list = $model->with(['iconImage'])->hidden(['iconImage'])->order(['sort' => 'desc', 'create_time' => 'desc'])->paginate(10); |
|
|
|
|
return $this->renderSuccess(compact('list')); |
|
|
|
@ -306,7 +322,8 @@ class Server extends Controller |
|
|
|
|
/** |
|
|
|
|
* 服务配置添加 |
|
|
|
|
*/ |
|
|
|
|
public function configAdd() { |
|
|
|
|
public function configAdd() |
|
|
|
|
{ |
|
|
|
|
$model = new StoreServerConfig(); |
|
|
|
|
if ($model->save(array_merge(['store_id' => $this->storeId], $this->postForm()))) { |
|
|
|
|
return $this->renderSuccess('新增成功'); |
|
|
|
@ -317,7 +334,8 @@ class Server extends Controller |
|
|
|
|
/** |
|
|
|
|
* 服务配置编辑 |
|
|
|
|
*/ |
|
|
|
|
public function configEdit(int $id) { |
|
|
|
|
public function configEdit(int $id) |
|
|
|
|
{ |
|
|
|
|
$detail = StoreServerConfig::get($id); |
|
|
|
|
if ($detail) { |
|
|
|
|
if ($detail->save($this->postForm())) { |
|
|
|
@ -330,7 +348,8 @@ class Server extends Controller |
|
|
|
|
/** |
|
|
|
|
* 删除服务配置 |
|
|
|
|
*/ |
|
|
|
|
public function configDel(int $id) { |
|
|
|
|
public function configDel(int $id) |
|
|
|
|
{ |
|
|
|
|
$detail = StoreServerConfig::get($id); |
|
|
|
|
if ($detail->delete()) { |
|
|
|
|
return $this->renderSuccess('删除成功'); |
|
|
|
|