...
|
...
|
@@ -32,7 +32,6 @@ class Index extends Api |
|
|
* @ApiParams (name="LastYearMoney", type="string", required=true, description="上年营业额")
|
|
|
* @ApiParams (name="CompanyPeopleNum", type="string", required=true, description="公司员工数")
|
|
|
* @ApiParams (name="image", type="string", required=true, description="营业执照或负责人身份证照片")
|
|
|
* @ApiParams (name="Status", type="string", required=true, description="审核状态:0=待审核,1=审核通过,2=审核未通过")
|
|
|
* @ApiParams (name="CompanyName", type="string", required=true, description="公司或商号名称")
|
|
|
* @ApiParams (name="fa_address", type="string", required=true, description="法定地址")
|
|
|
* @ApiParams (name="yingye_address", type="string", required=true, description="营业地址")
|
...
|
...
|
@@ -83,7 +82,7 @@ class Index extends Api |
|
|
* @ApiParams (name="address_con", type="string", required=true, description="详细地址")
|
|
|
* @ApiParams (name="mobile", type="string", required=true, description="联系电话")
|
|
|
* @ApiParams (name="hours", type="string", required=true, description="营业时间")
|
|
|
* @ApiParams (name="Battery", type="string", required=true, description="电池分类Json数组['type_id':'1','num':'10']")
|
|
|
* @ApiParams (name="Battery", type="string", required=true, description="电池分类Json数组type_id.num)
|
|
|
* @ApiReturnParams (name="code", type="integer", required=true, sample="0")
|
|
|
* @ApiReturnParams (name="msg", type="string", required=true, sample="返回成功")
|
|
|
* @ApiReturn ({
|
...
|
...
|
@@ -144,7 +143,26 @@ class Index extends Api |
|
|
* @ApiReturn ({
|
|
|
'code':'1',
|
|
|
'msg':'返回成功',
|
|
|
'data':{
|
|
|
"data": {
|
|
|
"avatar": "http://kcd.qiniu.bronet.cn/uploads/20201027/lhOJtzf7HMlBaF2HRJXbDb9OaaZ_.jpg",
|
|
|
"name": "王二蛋的店",
|
|
|
"address": "天津市河东区大直沽街道汇贤里安教小区",
|
|
|
"lng": "117.244942",
|
|
|
"lat": "39.119204",
|
|
|
"address_con": "天津市",
|
|
|
"mobile": "13292442918", //联系方式
|
|
|
"hours": "1213", 营业时间
|
|
|
"Battery": [ //电池分类
|
|
|
{
|
|
|
"type_id": "1",
|
|
|
"num": "10"
|
|
|
},
|
|
|
{
|
|
|
"type_id": "2",
|
|
|
"num": "10"
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
})
|
|
|
*/
|
|
|
public function UpdateStorBack()
|
...
|
...
|
@@ -242,7 +260,7 @@ class Index extends Api |
|
|
* @ApiRoute (/api/Index/Agreement)
|
|
|
* @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
|
|
|
* @ApiParams (name="name", type="string", required=true, description="姓名")
|
|
|
* @ApiParams (name="seller_id", type="string", required=true, description="门店ID")
|
|
|
* @ApiParams (name="seller_id", type="string", required=true, description="服务商ID")
|
|
|
* @ApiParams (name="battery_id", type="string", required=true, description="电池类型")
|
|
|
* @ApiParams (name="card_image", type="string", required=true, description="身份证照片")
|
|
|
* @ApiParams (name="mobile", type="string", required=true, description="联系方式")
|
...
|
...
|
@@ -251,7 +269,7 @@ class Index extends Api |
|
|
* @ApiReturn ({
|
|
|
'code':'1',
|
|
|
'msg':'返回成功',
|
|
|
'data':{
|
|
|
"data": "202010290928196016917223" //订单号 用订单号去调支付
|
|
|
})
|
|
|
*/
|
|
|
public function Agreement()
|
...
|
...
|
@@ -336,7 +354,8 @@ class Index extends Api |
|
|
->where($mapC)
|
|
|
->order('id desc')
|
|
|
->page($params['pages'], $params['rows'])
|
|
|
->field('o.id,u.nickname,u.avatar,o.createtime');
|
|
|
->field('o.id,u.nickname,u.avatar,o.createtime')
|
|
|
->select();
|
|
|
$Count = Db::name('order')
|
|
|
->alias('o')
|
|
|
->join('stor s', 's.id=o.stor_id')
|
...
|
...
|
@@ -347,7 +366,8 @@ class Index extends Api |
|
|
->where($mapC)
|
|
|
->order('id desc')
|
|
|
->page($params['pages'], $params['rows'])
|
|
|
->field('o.id,u.nickname,u.avatar,o.createtime');
|
|
|
->field('o.id,u.nickname,u.avatar,o.createtime')
|
|
|
->select();
|
|
|
$OrderCount = Db::name('order')
|
|
|
->alias('o')
|
|
|
->join('stor s', 's.id=o.stor_id')
|
...
|
...
|
@@ -391,7 +411,21 @@ class Index extends Api |
|
|
* @ApiReturn ({
|
|
|
'code':'1',
|
|
|
'msg':'返回成功',
|
|
|
'data':{
|
|
|
"data": {
|
|
|
"Count": 1, //数量
|
|
|
"List": [
|
|
|
{
|
|
|
"id": 1, //id
|
|
|
"nickname": "王叨叨",
|
|
|
"avatar": "https://thirdwx.qlogo.cn/mmopen/vi_32/5xl51Ja2tE9bZOVqrntjJX1He1xx6OfCEY6HIep0p4YtDzmM00NB6ia5S50AVLJv0dKHKPjOCF6jXQqhfrlKkyQ/132",
|
|
|
"UpMoney": "300.00", //押金
|
|
|
"Money": "200.00", //剩余租金
|
|
|
"mobile": "13292442918", //联系方式
|
|
|
"status": 0, //协议审核状态:0=待审核,1=协议中,2=已终止,3=已欠费,4=签约失败
|
|
|
"createtime": "2020-10-29" //协议生成时间
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
})
|
|
|
*/
|
|
|
public function MyCustomer()
|
...
|
...
|
@@ -411,7 +445,8 @@ class Index extends Api |
|
|
->where($map)
|
|
|
->page($params['pages'], $params['rows'])
|
|
|
->order('id desc')
|
|
|
->field('a.id,a.mobile,u.nickname,u.avatar,a.UpMoney,a.Money,a.createtime');
|
|
|
->field('a.id,a.mobile,u.nickname,a.status,u.avatar,a.UpMoney,a.Money,a.createtime')
|
|
|
->select();
|
|
|
$Count = Db::name('agreement')
|
|
|
->alias('a')
|
|
|
->join('seller s', 's.id=a.seller_id')
|
...
|
...
|
@@ -419,7 +454,8 @@ class Index extends Api |
|
|
->join('user u', 'u.id=a.user_id')
|
|
|
->where('a.status', $params['type'])
|
|
|
->order('id desc')
|
|
|
->field('a.id,u.nickname,a.status,u.avatar,a.UpMoney,a.Money,a.createtime');
|
|
|
->field('a.id,a.mobile,u.nickname,a.status,u.avatar,a.UpMoney,a.Money,a.createtime')
|
|
|
->select();
|
|
|
if (empty($Arr)) {
|
|
|
$data = [
|
|
|
'Count' => 0,
|
...
|
...
|
@@ -475,7 +511,8 @@ class Index extends Api |
|
|
->where('a.status', $params['type'])
|
|
|
->page($params['pages'], $params['rows'])
|
|
|
->order('id desc')
|
|
|
->field('a.id,a.OrderSn,u.avatar,u.nickname,a.updatetime,a.status');
|
|
|
->field('a.id,a.OrderSn,u.avatar,u.nickname,a.updatetime,a.status')
|
|
|
->select();
|
|
|
$Count = Db::name('agreement')
|
|
|
->alias('a')
|
|
|
->join('seller s', 's.id=a.seller_id')
|
...
|
...
|
@@ -483,7 +520,8 @@ class Index extends Api |
|
|
->where('s.user_id', $UserId)
|
|
|
->where('a.status', $params['type'])
|
|
|
->order('id desc')
|
|
|
->field('a.id,a.OrderSn,u.avatar,u.nickname,a.updatetime,a.status');
|
|
|
->field('a.id,a.OrderSn,u.avatar,u.nickname,a.updatetime,a.status')
|
|
|
->select();
|
|
|
if (empty($Arr)) {
|
|
|
$data = [
|
|
|
'Count' => 0,
|
...
|
...
|
@@ -526,6 +564,10 @@ class Index extends Api |
|
|
{
|
|
|
$Arr = Db::name('stor')->select();
|
|
|
$Code = input('battery_code');
|
|
|
if (empty($Code) || $Code == '' || $Code == "" || $Code == null) {
|
|
|
$this->error('请先链接蓝牙', 0);
|
|
|
die;
|
|
|
}
|
|
|
$map['BatteryCode'] = ['LIKE', '%' . $Code . '%'];
|
|
|
//用户电池分类ID
|
|
|
$Id = Db::name('battery_code')->where($map)->value('id');
|
...
|
...
|
@@ -572,7 +614,7 @@ class Index extends Api |
|
|
* @ApiReturnParams (name="code", type="integer", required=true, sample="0")
|
|
|
* @ApiReturnParams (name="msg", type="string", required=true, sample="返回成功")
|
|
|
* @ApiReturn ({
|
|
|
'code':'1',
|
|
|
'code':'1', //99998 请先签订协议 跳转签订
|
|
|
'msg':'返回成功',
|
|
|
'data':{
|
|
|
})
|
...
|
...
|
@@ -581,7 +623,7 @@ class Index extends Api |
|
|
{
|
|
|
$UserId = $this->IsToken($this->request->header());
|
|
|
$params = $this->request->param();
|
|
|
$map['BatteryCode'] = ['IN', $params['battery_code']];
|
|
|
$map['BatteryCode'] = ['LIKE', '%' . $params['battery_code'] . '%'];
|
|
|
//用户电池分类ID
|
|
|
$Id = Db::name('battery_code')->where($map)->value('id');
|
|
|
if (empty($Id)) {
|
...
|
...
|
@@ -623,6 +665,7 @@ class Index extends Api |
|
|
* @ApiMethod (POST)
|
|
|
* @ApiRoute (/api/Index/MyOrder)
|
|
|
* @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
|
|
|
* @ApiParams (name="type", type="string", required=true, description="订单状态:0=待换电,1=已换电,9=全部")
|
|
|
* @ApiParams (name="pages", type="string", required=true, description="pages")
|
|
|
* @ApiParams (name="rows", type="string", required=true, description="rows")
|
|
|
* @ApiReturnParams (name="code", type="integer", required=true, sample="0")
|
...
|
...
|
@@ -630,29 +673,56 @@ class Index extends Api |
|
|
* @ApiReturn ({
|
|
|
'code':'1',
|
|
|
'msg':'返回成功',
|
|
|
'data':{
|
|
|
"data": {
|
|
|
"Count": 1, //总数
|
|
|
"List": [
|
|
|
{
|
|
|
"id": 1,
|
|
|
"OrderSn": "202010291005404651432049",
|
|
|
"battery_code": "123", //设备号
|
|
|
"nickname": "王叨叨",
|
|
|
"avatar": "https://thirdwx.qlogo.cn/mmopen/vi_32/5xl51Ja2tE9bZOVqrntjJX1He1xx6OfCEY6HIep0p4YtDzmM00NB6ia5S50AVLJv0dKHKPjOCF6jXQqhfrlKkyQ/132",
|
|
|
"status": 0, 订单状态:0=待换电,1=已换电,2=已过期,3=异常订单
|
|
|
"createtime": 2020-10-27, //下单时间
|
|
|
"ok_time": "", //完成时间
|
|
|
"title": "电池类型一", // 电池类型
|
|
|
"manufactor": "1231", //厂家
|
|
|
"Voltage": "123", // 电压
|
|
|
"yes_time": "" //商家确认时间
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
})
|
|
|
*/
|
|
|
public function MyOrder()
|
|
|
{
|
|
|
$UserId = $this->IsToken($this->request->header());
|
|
|
$params = $this->request->param();
|
|
|
$Map = [];
|
|
|
if ($params['type'] != 9) {
|
|
|
$Map['o.status'] = ['eq', $params['type']];
|
|
|
}
|
|
|
$Arr = Db::name('order')
|
|
|
->alias('o')
|
|
|
->join('stor s', 's.id=a.stor_id')
|
|
|
->join('stor s', 's.id=o.stor_id')
|
|
|
->where('s.user_id', $UserId)
|
|
|
->page($params['pages'], $params['rows'])
|
|
|
->where($Map)
|
|
|
->join('user u', 'u.id=o.user_id')
|
|
|
->join('battery_code b', 'b.id=o.battery_id')
|
|
|
->order('id desc')
|
|
|
->field('o.id,o.OrderSn,o.battery_code,u.nickname,u.avatar,o.status,o.createtime,o.ok_time,b.title,o.manufactor,o.Voltage,o.yes_time');
|
|
|
->field('o.id,o.OrderSn,o.battery_code,u.nickname,u.avatar,o.status,o.createtime,o.ok_time,b.title,o.manufactor,o.Voltage,o.yes_time')
|
|
|
->select();
|
|
|
$Count = Db::name('order')
|
|
|
->alias('o')
|
|
|
->join('stor s', 's.id=a.stor_id')
|
|
|
->join('stor s', 's.id=o.stor_id')
|
|
|
->where('s.user_id', $UserId)
|
|
|
->where($Map)
|
|
|
->join('user u', 'u.id=o.user_id')
|
|
|
->join('battery_code b', 'b.id=o.battery_id')
|
|
|
->order('id desc')
|
|
|
->field('o.id,o.OrderSn,o.battery_code,u.nickname,u.avatar,o.status,o.createtime,o.ok_time,b.title,o.manufactor,o.Voltage,o.yes_time');
|
|
|
->field('o.id,o.OrderSn,o.battery_code,u.nickname,u.avatar,o.status,o.createtime,o.ok_time,b.title,o.manufactor,o.Voltage,o.yes_time')
|
|
|
->select();
|
|
|
if (empty($Arr)) {
|
|
|
$data = [
|
|
|
'Count' => 0,
|
...
|
...
|
@@ -666,12 +736,20 @@ class Index extends Api |
|
|
$List[$k]['nickname'] = $v['nickname'];
|
|
|
$List[$k]['avatar'] = $v['avatar'];
|
|
|
$List[$k]['status'] = $v['status'];
|
|
|
$List[$k]['createtime'] = $v['createtime'];
|
|
|
$List[$k]['ok_time'] = $v['ok_time'];
|
|
|
$List[$k]['createtime'] = date('Y-m-d H:i:s', $v['createtime']);
|
|
|
if ($v['ok_time'] == null) {
|
|
|
$List[$k]['ok_time'] = '';
|
|
|
} else {
|
|
|
$List[$k]['ok_time'] = date('Y-m-d H:i:s', $v['ok_time']);
|
|
|
}
|
|
|
$List[$k]['title'] = $v['title'];
|
|
|
$List[$k]['manufactor'] = $v['manufactor'];
|
|
|
$List[$k]['Voltage'] = $v['Voltage'];
|
|
|
$List[$k]['yes_time'] = $v['yes_time'];
|
|
|
if ($v['yes_time'] == null) {
|
|
|
$List[$k]['yes_time'] = '';
|
|
|
} else {
|
|
|
$List[$k]['yes_time'] = date('Y-m-d H:i:s', $v['yes_time']);
|
|
|
}
|
|
|
}
|
|
|
$data = [
|
|
|
'Count' => count($Count),
|
...
|
...
|
@@ -696,7 +774,20 @@ class Index extends Api |
|
|
* @ApiReturn ({
|
|
|
'code':'1',
|
|
|
'msg':'返回成功',
|
|
|
'data':{
|
|
|
"data": {
|
|
|
"Count": 1, //总数
|
|
|
"List": [
|
|
|
{
|
|
|
"id": 1,
|
|
|
"OrderSn": "202010290928196016917223", //订单
|
|
|
"UpMoney": "300.00", //押金
|
|
|
"Money": "200.00", //剩余租金
|
|
|
"status": 2, 协议审核状态:0=待审核,1=协议中,2=已终止,3=已欠费,4=签约失败
|
|
|
"refind_status": 3, 退款审核状态:0=待审核,1=已通过,2=已拒绝,3=未发起退款
|
|
|
"CompanyName": "王二蛋的垃圾站"
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
})
|
|
|
*/
|
|
|
public function MyUpMoney()
|
...
|
...
|
@@ -706,14 +797,18 @@ class Index extends Api |
|
|
$Arr = Db::name('agreement')
|
|
|
->alias('a')
|
|
|
->where('a.user_id', $UserId)
|
|
|
->join('seller s', 's.id=a.seller_id')
|
|
|
->page($params['pages'], $params['rows'])
|
|
|
->order('id desc')
|
|
|
->field('a.id,a.OrderSn,a.UpMoney,a.Money,a.status,a.refind_status,a.CompanyName');
|
|
|
->field('a.id,a.OrderSn,a.UpMoney,a.Money,a.status,a.refind_status,s.CompanyName')
|
|
|
->select();
|
|
|
$Count = Db::name('agreement')
|
|
|
->alias('a')
|
|
|
->join('seller s', 's.id=a.seller_id')
|
|
|
->where('a.user_id', $UserId)
|
|
|
->order('id desc')
|
|
|
->field('a.id,a.OrderSn,a.UpMoney,a.Money,a.status,a.refind_status,a.CompanyName');
|
|
|
->field('a.id,a.OrderSn,a.UpMoney,a.Money,a.status,a.refind_status,s.CompanyName')
|
|
|
->select();
|
|
|
if (empty($Arr)) {
|
|
|
$data = [
|
|
|
'Count' => 0,
|
...
|
...
|
|