|
|
@ -48,6 +48,25 @@ class Merchant extends Controller |
|
|
|
return $this->renderError($model->getError() ?: '更新失败'); |
|
|
|
return $this->renderError($model->getError() ?: '更新失败'); |
|
|
|
} |
|
|
|
} |
|
|
|
return $this->renderSuccess('更新成功'); |
|
|
|
return $this->renderSuccess('更新成功'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 更新商城信息 |
|
|
|
|
|
|
|
* @return Json |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public function add(): Json |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
// 商城详情 |
|
|
|
|
|
|
|
//$model = MerchantModel::detail($this->storeId); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 新增记录 |
|
|
|
|
|
|
|
$model = new MerchantModel; |
|
|
|
|
|
|
|
$data = $this->postForm(); |
|
|
|
|
|
|
|
if ($model->add($data)) { |
|
|
|
|
|
|
|
return $this->renderSuccess('添加成功'); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return $this->renderError($model->getError() ?: '添加失败'); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|