|
@@ -4,6 +4,7 @@ namespace app\api\controller\user;
|
|
|
|
|
|
|
|
use app\http\validates\user\AddressValidate;
|
|
use app\http\validates\user\AddressValidate;
|
|
|
use app\models\system\SystemCity;
|
|
use app\models\system\SystemCity;
|
|
|
|
|
+use app\models\user\UserSpread;
|
|
|
use app\models\user\UserVisit;
|
|
use app\models\user\UserVisit;
|
|
|
use think\db\exception\DataNotFoundException;
|
|
use think\db\exception\DataNotFoundException;
|
|
|
use think\db\exception\DbException;
|
|
use think\db\exception\DbException;
|
|
@@ -611,7 +612,10 @@ class UserController
|
|
|
$puid = $request->post('puid/d', 0);
|
|
$puid = $request->post('puid/d', 0);
|
|
|
$phone = $request->post('phone', 0);
|
|
$phone = $request->post('phone', 0);
|
|
|
if (!$puid) $puid = User::where('phone', $phone)->value('uid');
|
|
if (!$puid) $puid = User::where('phone', $phone)->value('uid');
|
|
|
- return app('json')->success(User::setSpread($puid, $request->uid()));
|
|
|
|
|
|
|
+ if (!User::setSpread($puid, $request->uid())) {
|
|
|
|
|
+ return app('json')->fail(UserSpread::getErrorInfo());
|
|
|
|
|
+ }
|
|
|
|
|
+ return app('json')->success('成功');
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public function tradeIntegral(Request $request)
|
|
public function tradeIntegral(Request $request)
|