Commit 4d433bd0 by 杨树贤

添加上传商品和报价的增加红包金额操作

parent 9281a9ba
......@@ -7,7 +7,7 @@ SYSTEM_CODE=09
SYSTEM_NAME=商品Api
ELK_NAME=ic_welfare_api
BaseUrl=http://192.168.10.10:61009
BaseUrl=http://192.168.10.20:61009
#BaseUrl=http://ic_server_welfare.test
ES_URL=http://soapi.icsales.com:8001
authapi=http://authapi.icsales.cc
......
......@@ -56,8 +56,6 @@ class CheckInController extends Controller
$result = $this->service->addCheckIn($map);
if ($result['errcode'] === self::SUCCESS) {
return $this->Export(0, 'ok');
} elseif ($result['errcode'] === 109001) {
return $this->Export(self::CAN_NOT_CHECK_IN_AGAIN);
} else {
return $this->Export(self::CHECK_IN_FAIL);
}
......
......@@ -9,8 +9,19 @@ class Controller extends BaseController
{
const SUCCESS = 0;
const CAN_NOT_CHECK_IN_AGAIN = 109101;
const CHECK_IN_FAIL = 109102;
//这个是服务那边返回的错误码,代表已经超出了每日每人可领取的对应项的数额(比如每人每天只能签到一次)
const INTEGRAL_LIMIT = 109001;
//下面的都是这个接口项目的错误码
//签到
const CHECK_IN_FAIL = 109101;
//报价
const OFFER_FAIL = 109102;
//上传商品
const UPLOAD_GOODS_FAIL = 109103;
public function Export($Errcode = 0, $ErrMsg = '', $dataArr = [])
{
......
<?php
namespace App\Http\Controllers;
use App\Services\OfferService;
use Illuminate\Http\Request;
class OffersController extends Controller
{
private $service;
public function __construct(OfferService $service)
{
$this->service = $service;
}
//回复报价的类型id
const INTEGRAL_TYPE_OFFER = 5;
public function store(Request $request)
{
$userId = $request->user->user_id;
$integralId = self::INTEGRAL_TYPE_OFFER;
$map = [
'user_id' => $userId,
'integral_id' => $integralId,
];
$result = $this->service->addOffer($map);
if ($result['errcode'] === self::SUCCESS) {
return $this->Export(0, 'ok');
} else {
return $this->Export(self::OFFER_FAIL);
}
}
}
\ No newline at end of file
<?php
namespace App\Http\Controllers;
use App\Services\OfferService;
use App\Services\UploadGoodsService;
use Illuminate\Http\Request;
class UploadGoodsController extends Controller
{
private $service;
public function __construct(UploadGoodsService $service)
{
$this->service = $service;
}
//回复报价的类型id
const INTEGRAL_TYPE_UPLOAD_GOODS = 2;
public function store(Request $request)
{
$userId = $request->user->user_id;
$integralId = self::INTEGRAL_TYPE_UPLOAD_GOODS;
$map = [
'user_id' => $userId,
'integral_id' => $integralId,
];
$result = $this->service->addUploadGoods($map);
if ($result['errcode'] === self::SUCCESS) {
return $this->Export(0, 'ok');
} else {
return $this->Export(self::UPLOAD_GOODS_FAIL);
}
}
}
\ No newline at end of file
<?php
namespace App\Services;
class OfferService
{
//回复报价需要添加流水
public function addOffer($map = [])
{
$url = config('website.BaseUrl') . '/integral_bills/add';
$result = reportCurl($url, $map, true);
$result = json_decode($result, true);
return $result;
}
}
\ No newline at end of file
<?php
namespace App\Services;
class UploadGoodsService
{
//回复报价需要添加流水
public function addUploadGoods($map = [])
{
$url = config('website.BaseUrl') . '/integral_bills/add';
$result = reportCurl($url, $map, true);
$result = json_decode($result, true);
return $result;
}
}
\ No newline at end of file
......@@ -13,8 +13,12 @@ return [
109003 => '登录失败',
109100 => '参数不正确或者缺失,请检查请求的参数',
109101 => '今天已签到过,无法再次签到',
109102 => '签到失败',
109101 => '今天已签到过',
109102 => '签到添加红包失败',
109103 => '今天已报价过',
109104 => '报价添加红包失败',
109105 => '今天已经上传商品过',
109106 => '上传商品添加红包失败',
],
......
......@@ -28,6 +28,13 @@ $router->group(['middleware' => ['web', 'login']], function () use ($router) {
//签到
$router->get('/check_in/list', 'CheckInController@index');
$router->post('/check_in/add', 'CheckInController@add');
//报价
$router->post('/offers/add', 'OffersController@store');
//上传商品
$router->post('/upload_goods/add', 'UploadGoodsController@store');
//红包活动信息
$router->get('/integrals/list', 'IntegralsController@index');
//红包获取流水
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment