1.提交缺失的东西
This commit is contained in:
@ -90,16 +90,16 @@ class UserAddressController extends BaseApiController
|
|||||||
public function add()
|
public function add()
|
||||||
{
|
{
|
||||||
$post = $this->request->post();
|
$post = $this->request->post();
|
||||||
$result = $this->validate($post, 'app\api\validate\UserAddress.add');
|
$result = $this->validate($post, 'app\api\validate\UserAddressValidate.add');
|
||||||
if ($result === true) {
|
if ($result === true) {
|
||||||
$user_id = $this->userId;
|
$user_id = $this->userId;
|
||||||
$result = UserAddressLogic::addUserAddress($user_id, $post);
|
$result = UserAddressLogic::addUserAddress($user_id, $post);
|
||||||
if ($result) {
|
if ($result) {
|
||||||
return $this->success('添加成功');
|
return $this->success('添加成功');
|
||||||
}
|
}
|
||||||
return $result = '添加失败';
|
$result = '添加失败';
|
||||||
}
|
}
|
||||||
$this->fail($result);
|
return $this->fail($result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -23,7 +23,7 @@ namespace app\api\validate;
|
|||||||
|
|
||||||
use think\Validate;
|
use think\Validate;
|
||||||
|
|
||||||
class UserAddress extends Validate
|
class UserAddressValidate extends Validate
|
||||||
{
|
{
|
||||||
|
|
||||||
protected $rule = [
|
protected $rule = [
|
||||||
Reference in New Issue
Block a user