add-api-srv_center

This commit is contained in:
lccsw
2022-09-19 16:54:37 +08:00
parent dceee41c31
commit d219eff999
3 changed files with 88 additions and 1 deletions
+67
View File
@@ -0,0 +1,67 @@
<?php
defined('WXAPP_APP') OR exit('No direct script access allowed');
/**
* Created by PhpStorm.
* User: 店铺信息
* Date: 2021/06/29
* Time: 20:17
*/
require_once APPPATH.'controllers/wxapp/Wxapp.php';
class Bsrv extends Wxapp{
private $biz_lists = [
[
'name'=>'黄伟江','biz_name'=>'福州胜华泰汽车销售有限公司','address'=>'福州市仓山区闽江大道112号',
'mobile'=>'18106055390','help_mobile'=>'18060789595','lat'=>'26.06782','lng'=>'119.2541','city_id'=>'350100','city_name'=>'福州'
],
[
'name'=>'陈凤英','biz_name'=>'泉州胜华祥汽车销售有限公司','address'=>'泉州市鲤城区常泰路78号',
'mobile'=>'13599728114','help_mobile'=>'18959811200','lat'=>'24.92279','lng'=>'118.51727','city_id'=>'350500','city_name'=>'泉州'
],
[
'name'=>'陈晓贞','biz_name'=>'厦门胜华元汽车销售有限公司','address'=>'厦门市湖里区翔云三路',
'mobile'=>'18059209316','help_mobile'=>'18059209323','lat'=>'24.530149','lng'=>'118.132912','city_id'=>'350200','city_name'=>'厦门'
],
];
function __construct($inputs, $app_key){
parent::__construct($inputs, $app_key);
$this->login_white = array();//登录白名单
$this->majia_white = array();//超级管理员披上马甲可操作权限
$this->check_status = array();//用户状态校验
$this->check_mobile = array();//需要手机号
$this->check_headimg =array();//授权微信信息
// $this->load->model('app/liche/app_liche_srvcenter_model','srvcenter_model');
$this->load->model('receiver/order/receiver_orders_v2_model');
$this->load->model("biz/biz_model");
}
/**
* 获取店铺信息
* @return array
* @throws Exception
*/
protected function get(){
$oid = $this->input_param('oid');
$order = $this->receiver_orders_v2_model->get(['id'=>$oid]);
if(!$order){
throw new Exception('订单不存在', API_CODE_FAIL);
}
$re_biz = $this->biz_model->get(['id' => $order['biz_id']]);
$city_id = $re_biz['city_id'] ? $re_biz['city_id'] : '350200';
// $row = $this->srvcenter_model->get(['city_id'=>$city_id]);
$rows = $this->biz_lists;
$data = [
'city_id' => $city_id,
'inline_info' => [
'mobile' => '18030158235',
'time' => '周一到周五 9:00-18:00',
'msg' => '如您需要救援服务,请联系[24小时救援热线]'
],
'lists' => $rows
];
return $data;
}
}
+6 -1
View File
@@ -463,6 +463,10 @@ class User extends Wxapp{
$brand_name = isset($brands[$val['brand_id']]) ? $brands[$val['brand_id']][0]['name'] : '';
$serie_name = isset($series[$val['s_id']]) ? $series[$val['s_id']][0]['name'] : '';
$show_srv = false;
if(in_array($val['brand_id'],[1,6])){ //东风启辰和东风EV 显示店铺地址
$show_srv = true;
}
$lists[] = [
'o_id' => $val['id'],
'title' => "{$brand_name}{$serie_name}",
@@ -475,7 +479,8 @@ class User extends Wxapp{
'platenumber' => $platenumber,
'ins_company' => $ins_company,
'insure' => $insure,
'other' => $other
'other' => $other,
'show_srv' => $show_srv
];
}
}
+15
View File
@@ -0,0 +1,15 @@
<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* User: lcc
* Date: 2022/09/19
* Time: 16:24
*/
class App_liche_srvcenter_model extends HD_Model{
private $table_name = 'lc_app_liche_srvcenter';
public function __construct()
{
parent::__construct($this->table_name, 'default');
}
}