...
|
...
|
@@ -53,6 +53,34 @@ class Store extends Api |
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 入驻协议
|
|
|
* @ApiWeigh (90)
|
|
|
*
|
|
|
* @ApiTitle (入驻协议)
|
|
|
* @ApiSummary (入驻协议)
|
|
|
* @ApiMethod (POST)
|
|
|
* @ApiRoute (/api/store/settled)
|
|
|
* @ApiReturnParams (name="code", type="integer", required=true, sample="0")
|
|
|
* @ApiReturnParams (name="msg", type="string", required=true, sample="返回成功")
|
|
|
* @ApiReturn ({
|
|
|
'code':'1',
|
|
|
'msg':'返回成功',
|
|
|
"data": {
|
|
|
"settled": 入驻协议,
|
|
|
}
|
|
|
})
|
|
|
*/
|
|
|
public function settled()
|
|
|
{
|
|
|
if($this->request->isPost()){
|
|
|
$return = [
|
|
|
'settled' => config('site.settled')
|
|
|
];
|
|
|
$this->success('成功',$return);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 行业列表
|
|
|
* @ApiWeigh (80)
|
|
|
*
|
...
|
...
|
@@ -121,6 +149,22 @@ class Store extends Api |
|
|
public function store_add()
|
|
|
{
|
|
|
$param = (new StoreValidate())->goCheck('store_add');
|
|
|
$where_s = ['user_id'=>$this->user_id];
|
|
|
$where = [
|
|
|
'where' => $where_s
|
|
|
];
|
|
|
$store = $this->store_model->findOrFail($where,false,'*','createtime');
|
|
|
if($store) {
|
|
|
if($store['status'] == 1) {
|
|
|
$param['id'] = $store['id'];
|
|
|
}
|
|
|
if($store['status'] == 2) {
|
|
|
$this->error('商家申请仍在审核中');
|
|
|
}
|
|
|
if($store['status'] == 3) {
|
|
|
$this->error('商家申请已通过');
|
|
|
}
|
|
|
}
|
|
|
$order_sn = $param['order_sn'] = get_order_sn();
|
|
|
$pay_data = [];
|
|
|
// if($this->auth->end_time > time()) {
|
...
|
...
|
@@ -155,7 +199,11 @@ class Store extends Api |
|
|
$result_invite = true;
|
|
|
try{
|
|
|
$param['user_id'] = $this->auth->id;
|
|
|
$result = $this->store_model->add($param);
|
|
|
if(!empty($param['id'])) {
|
|
|
$result = $this->store_model->edit($param);
|
|
|
} else {
|
|
|
$result = $this->store_model->add($param);
|
|
|
}
|
|
|
$id = $this->store_model->id;
|
|
|
Db::commit();
|
|
|
} catch (PDOException $e) {
|
...
|
...
|
@@ -270,7 +318,15 @@ class Store extends Api |
|
|
* @ApiReturnParams (name="msg", type="string", required=true, sample="返回成功")
|
|
|
* @ApiReturn ({
|
|
|
'code':'1',
|
|
|
'msg':'返回成功'
|
|
|
'msg':'返回成功',
|
|
|
"data": {
|
|
|
"id": 1,
|
|
|
"store_name": "123",
|
|
|
"image_arr": [
|
|
|
"http://cloud.caiyunpan.brotop.cn/assets/img/qrcode.png",
|
|
|
"http://cloud.caiyunpan.brotop.cn/assets/img/qrcode.png"
|
|
|
]
|
|
|
}
|
|
|
})
|
|
|
*/
|
|
|
public function store()
|
...
|
...
|
@@ -458,7 +514,7 @@ class Store extends Api |
|
|
|
|
|
/**
|
|
|
* 留言消息
|
|
|
* @ApiWeigh (80)
|
|
|
* @ApiWeigh (24)
|
|
|
*
|
|
|
* @ApiTitle (留言消息)
|
|
|
* @ApiSummary (留言消息)
|
...
|
...
|
@@ -472,27 +528,27 @@ class Store extends Api |
|
|
'code':'1',
|
|
|
'msg':'返回成功',
|
|
|
"data": {
|
|
|
"list": [
|
|
|
{
|
|
|
"id": 1,
|
|
|
"name": "行业名称",
|
|
|
"weigh": 0,
|
|
|
}
|
|
|
]
|
|
|
"list": [
|
|
|
{
|
|
|
"id": 1,
|
|
|
"name": "行业名称",
|
|
|
"weigh": 0,
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
})
|
|
|
*/
|
|
|
public function store_list()
|
|
|
public function comment_list()
|
|
|
{
|
|
|
if($this->request->isPost()){
|
|
|
$param = (new StoreValidate())->goCheck('comment_reply');
|
|
|
$param = (new StoreValidate())->goCheck('common');
|
|
|
$store = $this->get_store();
|
|
|
$page = $param['page'];
|
|
|
$where = [
|
|
|
'where' => ['store_id'=>$store['id']],
|
|
|
'with' => ['user_info']
|
|
|
];
|
|
|
$order = ['number'=>'DESC','createtime'=>'DESC'];
|
|
|
$order = ['createtime'=>'DESC'];
|
|
|
$model = new StoreComment();
|
|
|
$comment = $model->pageSelect($page,$where,'*',$order,config('option.num'));
|
|
|
$list = $comment->items();
|
...
|
...
|
@@ -506,11 +562,55 @@ class Store extends Api |
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 留言消息
|
|
|
* @ApiWeigh (50)
|
|
|
* 留言消息详情
|
|
|
* @ApiWeigh (23)
|
|
|
*
|
|
|
* @ApiTitle (留言消息)
|
|
|
* @ApiSummary (留言消息)
|
|
|
* @ApiTitle (留言消息详情)
|
|
|
* @ApiSummary (留言消息详情)
|
|
|
* @ApiMethod (POST)
|
|
|
* @ApiRoute (/api/store/comment_detail)
|
|
|
* @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
|
|
|
* @ApiParams (name="comment_id", type="integer", required=true, description="留言id")
|
|
|
* @ApiReturnParams (name="code", type="integer", required=true, sample="0")
|
|
|
* @ApiReturnParams (name="msg", type="string", required=true, sample="返回成功")
|
|
|
* @ApiReturn ({
|
|
|
'code':'1',
|
|
|
'msg':'返回成功',
|
|
|
"data": {
|
|
|
"comment": [
|
|
|
{
|
|
|
"id": 1,
|
|
|
"name": "行业名称",
|
|
|
"weigh": 0,
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
})
|
|
|
*/
|
|
|
public function comment_detail()
|
|
|
{
|
|
|
if($this->request->isPost()){
|
|
|
$param = (new StoreValidate())->goCheck('comment_detail');
|
|
|
$store = $this->get_store();
|
|
|
$where = [
|
|
|
'where' => ['id'=>$param['comment_id']],
|
|
|
'with' => ['user_info']
|
|
|
];
|
|
|
$model = new StoreComment();
|
|
|
$comment = $model->findOrFail($where,'*');
|
|
|
$return = [
|
|
|
'comment' => $comment
|
|
|
];
|
|
|
$this->success('请求成功',$return);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 留言回复
|
|
|
* @ApiWeigh (22)
|
|
|
*
|
|
|
* @ApiTitle (留言回复)
|
|
|
* @ApiSummary (留言回复)
|
|
|
* @ApiMethod (POST)
|
|
|
* @ApiRoute (/api/store/comment_reply)
|
|
|
* @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
|
...
|
...
|
@@ -561,29 +661,26 @@ class Store extends Api |
|
|
'code':'1',
|
|
|
'msg':'返回成功',
|
|
|
"data": {
|
|
|
"list": [
|
|
|
{
|
|
|
"id": 1,
|
|
|
"name": "行业名称",
|
|
|
"weigh": 0,
|
|
|
}
|
|
|
]
|
|
|
"list": [
|
|
|
{
|
|
|
"id": 1,
|
|
|
"money": "充值金额",
|
|
|
"score": "赠送板币",
|
|
|
"weigh": 1,
|
|
|
},
|
|
|
]
|
|
|
}
|
|
|
})
|
|
|
*/
|
|
|
public function deposit()
|
|
|
{
|
|
|
if($this->request->isPost()){
|
|
|
$keyword = $this->request->param('keyword','');
|
|
|
$where = [
|
|
|
'where' => []
|
|
|
];
|
|
|
if($keyword) {
|
|
|
$where['where'] = ['name'=>['like','%'.$keyword.'%']];
|
|
|
}
|
|
|
$indus = $this->industry_model->selectOrFail($where,false,'*','weigh');
|
|
|
$deposit = $this->deposit_model->selectOrFail($where,false,'*','weigh');
|
|
|
$return = [
|
|
|
'list' => $indus,
|
|
|
'list' => $deposit,
|
|
|
];
|
|
|
$this->success('请求成功',$return);
|
|
|
}
|
...
|
...
|
@@ -635,6 +732,7 @@ class Store extends Api |
|
|
$order_result = $payment->pay($order);
|
|
|
if($order_result['return_code'] == 'SUCCESS' && $order_result['result_code'] == 'SUCCESS') {
|
|
|
$prepayId = $order_result->prepay_id;
|
|
|
$pay_data = $payment->configForJSSDKPayment($prepayId); // 返回数组
|
|
|
} else {
|
|
|
$this->error($order_result['return_msg']);
|
|
|
}
|
...
|
...
|
|