Browse Source

api文档

master
ZLW-PC\Administrator 7 years ago
parent
commit
17ee86640e
  1. 5215
      API文档.html
  2. 3
      README.md
  3. 1
      app/Common/function.php
  4. 3
      app/Http/Controllers/Api/ArctypeController.php
  5. 1
      app/Http/Controllers/Api/ArticleController.php
  6. 3
      app/Http/Controllers/Api/CommentController.php
  7. 3
      app/Http/Controllers/Api/OrderController.php
  8. 10
      app/Http/Controllers/Api/QrcodeController.php
  9. 2
      app/Http/Model/Goods.php
  10. 5
      routes/web.php

5215
API文档.html
File diff suppressed because it is too large
View File

3
README.md

@ -30,9 +30,12 @@ WAP端
注意:PC端跟微商城的域名是同一个域名,WAP端的域名通常是PC端的子域名,这里的案例PC端的域名是www.lqycms.com,WAP端的域名是m.lqycms.com
PC入口:http://+PC域名+/
WAP入口:http://+WAP域名+/,WAP域名解析与PC域名一致,都是指向同一目录下
微商城入口:http://+PC域名+/weixin,支付仅支持微信支付。
6、后台功能
1) 文章管理:增删改查,栏目管理
2) 单页管理

1
app/Common/function.php

@ -1138,6 +1138,7 @@ function get_table_columns($table, $field='')
return $res;
}
//获取http(s)://+域名
function http_host($flag=true)
{
$res = '';

3
app/Http/Controllers/Api/ArctypeController.php

@ -41,8 +41,9 @@ class ArctypeController extends CommonController
public function arctypeDetail(Request $request)
{
//参数
$data['id'] = $request->input('id');
$data['id'] = $request->input('id','');
$data['is_show'] = Arctype::IS_SHOW;
if($data['id']==''){return ReturnData::create(ReturnData::PARAMS_ERROR);}
$res = Arctype::getOne($data);
if($res === false)

1
app/Http/Controllers/Api/ArticleController.php

@ -44,6 +44,7 @@ class ArticleController extends CommonController
//参数
$data['id'] = $request->input('id');
$data['ischeck'] = Article::IS_CHECK;
if($data['id']==''){return ReturnData::create(ReturnData::PARAMS_ERROR);}
$res = Article::getOne($data);
if($res === false)

3
app/Http/Controllers/Api/CommentController.php

@ -43,11 +43,10 @@ class CommentController extends CommonController
$data['id_value'] = $request->input('id_value',null);
$data['content'] = $request->input('content',null);
$data['comment_rank'] = $request->input('comment_rank',null);
if($request->input('ip_address', null) !== null){$data['ip_address'] = $request->input('ip_address');}
if($request->input('ip_address', null) !== null){$data['ip_address'] = $request->input('ip_address');}else{$data['ip_address'] = Helper::getRemoteIp();}
if($request->input('parent_id', null) !== null){$data['parent_id'] = $request->input('parent_id');}
$data['add_time'] = time();
$data['user_id'] = Token::$uid;
$data['ip_address'] = Helper::getRemoteIp();
if($data['comment_type']===null || $data['id_value']===null || $data['content']===null || $data['comment_rank']===null)
{

3
app/Http/Controllers/Api/OrderController.php

@ -19,6 +19,9 @@ class OrderController extends CommonController
public function orderList(Request $request)
{
//参数
$data['limit'] = $request->input('limit', 10);
$data['offset'] = $request->input('offset', 0);
$data['user_id'] = Token::$uid;
$data['status'] = $request->input('status',-1);

10
app/Http/Controllers/Api/QrcodeController.php

@ -17,8 +17,16 @@ class QrcodeController extends CommonController
public function createSimpleQrcode(Request $request)
{
//参数
$url = $request->input('url');
$url = $request->input('url','');
$size = $request->input('size', 150);
$is_binary = $request->input('is_binary',0); //0表示不是二进制,1表示二进制流base64
if($url=='')
{
return ReturnData::create(ReturnData::PARAMS_ERROR);
}
if($is_binary==1){return Helper::qrcode($url,$size);}
return '<img src="'.Helper::qrcode($url,$size).'">';
}

2
app/Http/Model/Goods.php

@ -98,7 +98,7 @@ class Goods extends BaseModel
$model = $model->orderBy('price','asc'); //价格从低到高
break;
default:
$model = $model->orderBy('pubdate','desc'); //价格从低到高
$model = $model->orderBy('pubdate','desc'); //最新
}
}

5
routes/web.php

@ -185,7 +185,7 @@ Route::group(['prefix' => 'dataapi', 'namespace' => 'Api', 'middleware' => ['web
//评价
Route::get('/comment_list', 'CommentController@commentList'); //商品评价列表
Route::post('/comment_add', 'CommentController@commentAdd'); //商品评价添加
Route::post('/comment_batch_add', 'CommentController@commentBatchAdd'); //商品评价添加
Route::post('/comment_batch_add', 'CommentController@commentBatchAdd'); //商品评价批量添加
Route::post('/comment_update', 'CommentController@commentUpdate'); //商品评价修改
Route::post('/comment_delete', 'CommentController@commentDelete'); //商品评价删除
//商品收藏
@ -195,7 +195,7 @@ Route::group(['prefix' => 'dataapi', 'namespace' => 'Api', 'middleware' => ['web
//订单
Route::post('/order_add', 'OrderController@orderAdd'); //生成订单
Route::post('/order_update', 'OrderController@orderUpdate'); //订单修改
Route::post('/order_status_update', 'OrderController@orderStatusUpdate'); //订单修改
Route::post('/order_status_update', 'OrderController@orderStatusUpdate'); //订单状态修改
Route::get('/order_list', 'OrderController@orderList'); //订单列表
Route::get('/order_detail', 'OrderController@orderDetail'); //订单详情
//购物车
@ -229,6 +229,7 @@ Route::group(['prefix' => 'dataapi', 'namespace' => 'Api', 'middleware' => ['web
Route::get('/payment_list', 'PaymentController@paymentList'); //支付方式列表
//图片上传
Route::post('/image_upload', 'ImageController@imageUpload'); //普通文件/图片上传
Route::post('/multiple_file_upload', 'ImageController@multipleFileUpload'); //多文件上传
//二维码
Route::get('/create_simple_qrcode', 'QrcodeController@createSimpleQrcode');
//收货地址

Loading…
Cancel
Save