// +---------------------------------------------------------------------- declare (strict_types = 1); namespace app\api\controller\providers; use app\api\controller\Controller; use app\store\model\Shops; /** * 对外提供的接口服务 * Class OutServices * @package app\api\controller\balance */ class OutServices extends Controller { /** * 余额账单明细列表 * @return array * @throws \app\common\exception\BaseException * @throws \think\db\exception\DbException */ public function add() { $model = new Shops(); $data = $model->add($this->postData(),true); if ($data) { return $this->renderSuccess($data,'添加成功'); } return $this->renderError($model->getError()); } /** * 编辑门店 * @return array|\think\response\Json */ public function edit(){ $model = new Shops(); if ($model->edit($this->postData())) { return $this->renderSuccess('编辑成功'); } return $this->renderError($model->getError() ?: '编辑失败'); } }