Compare commits

...
3 Commits
Author SHA1 Message Date
fm453 974cc83476 修补api/gm接口的几处错误 2025-07-16 03:12:35 +08:00
fm453 d76625fb34 修补api/gm接口的几处错误 2025-07-14 00:27:23 +08:00
fm453 93d76b6e96 修正上传 2025-07-13 20:12:59 +08:00
15 changed files with 123 additions and 68 deletions
-13
View File
@@ -1,13 +0,0 @@
### 该问题是怎么引起的?
### 重现步骤
### 报错信息
-12
View File
@@ -1,12 +0,0 @@
### 相关的Issue
### 原因(目的、解决的问题等)
### 描述(做了什么,变更了什么)
### 测试用例(新增、改动、可能影响的功能)
+8 -4
View File
@@ -8,13 +8,14 @@
#### 软件架构
开发及建议运行环境:
- 后端:PHP版本:7.x或8.0;
- 数据库:mysql 5.6;
- 数据库:mysql 5.6;(框架版本升级至3.x以上后,将升级至8.0)
- APP及H5: 基于uni-app开发
- 桌面应用版:基于electron开发
- git: 版本管理
开发工具:
- phpstorm
- sublime text
- HbuilderX
- vs code
- H-builderX
字符编码格式:UTF-8
PHP环境扩展:
- mbstring,必须,判断中文字符串长度需要;
@@ -28,7 +29,10 @@
- 一份车主信息,至少关联了主数据源的会员表c_member、本应用数据源的车主表car_owner、会员扩展字段表user_ext
- 存在多应用(平台)时,一个车主可能会在不同平台留下的信息并不一样
#### 参与贡献
### 开发工具使用小记
1. phpstorm,使用git更新后,利用 工具-部署-远程主机,可将当前已变更文件复制上传到指定文件目录,方便更新覆盖。
### 参与贡献
1. 方孟(fm453)
-7
View File
@@ -1,12 +1,5 @@
<?php
# @Author: 嗨噜客(三亚) <fm453>
# @Date: 2022-05-15T22:35:59+08:00
# @Email: fm453@lukegzs.com
# @Last modified by: fm453
# @Last modified time: 2024-06-30T23:54:13+08:00
# @Copyright: www.hiluker.cn
//以下设置用于解决跨域访问的CORS问题,顺便设置来路域名白名单
const ORIGINARR = [
'https://ctms.hiluker.cn',
+1
View File
@@ -155,4 +155,5 @@ return [
99=>[0,-1],
], //费用单支付状态在财审时的前置状态要求
'H5Links'=>'//h5.ctms.hiluker.com/', //前端H5链接
'mainDomain'=>'//dacms.hiluker.cn', //主域名
];
@@ -37,6 +37,8 @@ class IndexController extends Common
{
$apis = [
'h5data'=>'拉取APP首页数据',
'ads-splash'=>'开屏广告',
'ads-banner'=>'首页BANNER广告'
];
$this->result('您正使用CMTS系统接口!', $apis, 200);
}
@@ -21,7 +21,7 @@
$apis = [
'list'=>'城市列表',
];
$this->result('您正使用CMTS-GM系统车主管理接口!', $apis, 200);
$this->result('您正使用CMTS-GM系统城市管理接口!', $apis, 200);
}
public function actionList()
@@ -37,10 +37,40 @@
{
$apis = [
'h5data' => '拉取APP首页数据',
'ads-splash' => '开屏广告',
'ads-banner' => '首页BANNER广告'
];
$this->result('您正使用CMTS-GM系统接口!', $apis, 200);
}
public function actionAdsSplash()
{
$ads = [
"http://public.hiluker.com/ctms/client/app-kp/kp01.jpg",
"http://public.hiluker.com/ctms/client/app-kp/kp03.jpg",
];
$this->result('开屏广告!', $ads, 200);
}
public function actionAdsBanner()
{
$ads = [
'0' => [
"image" => 'http://public.hiluker.com/ctms/client/app-banner/banner01.jpg',
"link" => '/pages/ctms/news/list/list'
],
'1' => [
"image" => 'http://public.hiluker.com/ctms/client/app-banner/banner03.jpg',
"link" => 'http://ctms.hiluker.cn'
],
'2' => [
"image" => 'http://public.hiluker.com/ctms/client/app-banner/banner02.jpg',
"link" => ''
]
];
$this->result('BANNER广告!', $ads, 200);
}
public function actionH5data()
{
$pid = $this->pid;
@@ -31,6 +31,7 @@
class JiaocheController extends Common
{
private $addtionWhere;
public function beforeAction($action)
{
if (!$this->pid) {
@@ -36,10 +36,13 @@ class NewsController extends Common
if (!$res) {
$this->result('没有查询到相应的数据!', [], 0);
}
$news = [];
foreach ($res as $v) {
$news[] = $v->toArray();
}
$data= [
'total'=>intval($s['query']->count()),
'news' => $res,
'news' => $news,
'page'=>$this->page
];
$this->result('文章查询成功!', $data, 200);
@@ -5,7 +5,7 @@ use addons\models\AcNewsCat;
use Yii;
use yii\data\Pagination;
class NewsCatController extends Common
class NewscatController extends Common
{
public function beforeAction($action)
{
@@ -37,10 +37,13 @@ class NewsCatController extends Common
if (!$res) {
$this->result('没有查询到相应的数据!', [], 0);
}
$cats = [];
foreach ($res as $v) {
$cats[$v->id] = $v->toArray();
}
$data= [
'total'=>intval($s['query']->count()),
'cats' => $res,
'cats' => $cats,
'page'=>$this->page
];
$this->result('文章分类查询成功!', $data, 200);
+32 -10
View File
@@ -36,10 +36,10 @@ class NoticeController extends Common
if (!$res) {
$this->result('没有查询到相应的数据!', [], 0);
}
$notices = $this->formatList($res);
$data= [
'total'=>intval($s['query']->count()),
'news' => $res,
'notices' => $notices,
'page'=>$this->page
];
$this->result('通知查询成功!', $data, 200);
@@ -58,7 +58,7 @@ class NoticeController extends Common
if($sn) $res->sn = $sn;
$res->save();
}
$this->result('文章信息查询完成', $res->toArray(), 200);
$this->result('通知信息查询完成', $res->toArray(), 200);
}
public function actionAdd()
@@ -133,20 +133,20 @@ class NoticeController extends Common
$detail->is_show = 0;
$res = $detail->save();
if ($res) {
$msg = '文章隐藏标记成功';
$msg = '通知隐藏标记成功';
$errorCode = 200;
} else {
$msg = '文章隐藏标记失败';
$msg = '通知隐藏标记失败';
}
break;
case 'show':
$detail->is_show = 1;
$res = $detail->save();
if ($res) {
$msg = '文章显示标记成功';
$msg = '通知显示标记成功';
$errorCode = 200;
} else {
$msg = '文章显示标记失败';
$msg = '通知显示标记失败';
}
break;
default:
@@ -176,9 +176,11 @@ class NoticeController extends Common
$data = $data->andwhere($where2);
}
$pages = new Pagination(['totalCount' => $data->count(), 'pageSize' => $this->pageSize]);
$res = $data->offset($pages->offset)->limit($pages->limit)->orderBy('order_by DESC')->all();
return ['res'=>$res,'query'=>$data];
$query = $data->offset($pages->offset)->limit($pages->limit);
//->orderBy('order_by DESC')
$res = $query->all();
$arr = $query->asArray()->all();
return ['res'=>$res,'query'=>$data,'arr'=>$arr];
}
/*
@@ -266,4 +268,24 @@ class NoticeController extends Common
return $data;
}
private function formatList($res)
{
$unsets = ['pid','create_at','deleted'];
$list = [];
foreach ($res as $s) {
$s = $s->toArray();
foreach ($unsets as $us) {
unset($s[$us]);
}
$weekdays = [0=>'日',1=>'一',2=>'二',3=>'三',4=>'四',5=>'五',6=>'六'];
$wk = date('w', $s['update_at']);
$s['updateTime'] = date('Y-m-d ', $s['update_at']) . '星期'.$weekdays[$wk];
$list[] = $s;
}
unset($s);
return $list;
}
}
+14 -2
View File
@@ -690,6 +690,15 @@
$search['is_commission'] = (int)$search['is_commission'];
$where[] = ['=', 'is_commission', $search['is_commission']];
}
//是否验车 TD:查询结果异常,待
if (isset($search['is_check'])) {
$search['is_check'] = (int)$search['is_check'];
if($search['is_check']){
$where[] = ['<>', 'checker', ''];
}else{
$where[] = ['=', 'checker', ''];
}
}
//运单是否通过了财务确认
$search['is_cwqr'] = $search['is_cwqr'] ?? ($get['is_cwqr'] ?? '');
if ($search['is_cwqr'] != '') {
@@ -1113,6 +1122,7 @@
{
$detail = $order->toArray();
if($detail['from_mid']){
$model = new Fans();
$fans = $model->findOne($detail['from_mid']);
$user = $fans->toArray();
@@ -1123,6 +1133,7 @@
$user[$ext['key']] = $ext['value'];
}
$detail['_user'] = $user;
}
if ($detail['store_id']) {
$model = new AcStore();
@@ -1180,7 +1191,7 @@
$detail['sn'] = $detail['sn'] ? $detail['sn'] : $sn;
$weekdays = [0 => '日', 1 => '一', 2 => '二', 3 => '三', 4 => '四', 5 => '五', 6 => '六'];
$wk = date('w', $detail['date']);
$wk = date('w', $detail['sign_date']);
$detail['signdate'] = date('Y-m-d 星期' . $weekdays[$wk], $detail['sign_date']);
$detail['from_province'] = isset($detail['start_province']) ? Yii::$app->params['regionAreas'][$detail['start_province']] : '';
$detail['to_province'] = isset($detail['aim_province']) ? Yii::$app->params['regionAreas'][$detail['aim_province']] : '';
@@ -1193,7 +1204,8 @@
$detail[$k] = $detail[$k] ? $detail[$k] : '/pics/nopic.jpg';
$url_pre = substr($detail[$k], 0, 4);
if ($url_pre == '/pic') {
$detail[$k . '_url'] = Url::to('@upload' . $detail[$k], $this->imgHttp);
// $detail[$k . '_url'] = Url::to('@upload' . $detail[$k], $this->imgHttp);
$detail[$k . '_url'] = Yii::$app->params['mainDomain'] .'/'.$imgDir. $detail[$k];
} else if ($url_pre == 'http') {
$detail[$k . '_url'] = $detail[$k];
}
@@ -37,10 +37,14 @@
$res = $s['res'];
if (!$res) {
$this->result('没有查询到相应的数据!', [], 0);
}
$stores = [];
foreach ($res as $v) {
$stores[] = $v->toArray();
}
$data= [
'total'=>$s['query']->count(),
'stores' => $res,
'stores' => $stores,
'page'=>$this->page
];
$this->result('网点列表查询成功!', $data, 200);
@@ -180,6 +184,7 @@
$pages = new Pagination(['totalCount' => $data->count(), 'pageSize' => $this->pageSize]);
$_orderby = 'order_by DESC';
$res = $data->offset($pages->offset)->limit($pages->limit)->orderBy($_orderby)->all();
return ['res'=>$res,'query'=>$data];
}
@@ -42,10 +42,14 @@
if (!$res) {
$this->result('没有查询到相应的数据!', [], 0);
}
$weituoren = [];
foreach ($res as $key=>$val) {
$weituoren[$key] = $val->toArray();
}
$data= [
'total'=>$s['query']->count(),
'weituoren' => $res,
'weituoren' => $weituoren,
'page'=>$this->page
];
$this->result('合作单位查询成功!', $data, 200);