Compare commits

...
2 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
12 changed files with 123 additions and 36 deletions
+8 -4
View File
@@ -8,13 +8,14 @@
#### 软件架构 #### 软件架构
开发及建议运行环境: 开发及建议运行环境:
- 后端:PHP版本:7.x或8.0; - 后端:PHP版本:7.x或8.0;
- 数据库:mysql 5.6; - 数据库:mysql 5.6;(框架版本升级至3.x以上后,将升级至8.0)
- APP及H5: 基于uni-app开发 - APP及H5: 基于uni-app开发
- 桌面应用版:基于electron开发 - 桌面应用版:基于electron开发
- git: 版本管理
开发工具: 开发工具:
- phpstorm - phpstorm
- sublime text - vs code
- HbuilderX - H-builderX
字符编码格式:UTF-8 字符编码格式:UTF-8
PHP环境扩展: PHP环境扩展:
- mbstring,必须,判断中文字符串长度需要; - mbstring,必须,判断中文字符串长度需要;
@@ -28,7 +29,10 @@
- 一份车主信息,至少关联了主数据源的会员表c_member、本应用数据源的车主表car_owner、会员扩展字段表user_ext - 一份车主信息,至少关联了主数据源的会员表c_member、本应用数据源的车主表car_owner、会员扩展字段表user_ext
- 存在多应用(平台)时,一个车主可能会在不同平台留下的信息并不一样 - 存在多应用(平台)时,一个车主可能会在不同平台留下的信息并不一样
#### 参与贡献 ### 开发工具使用小记
1. phpstorm,使用git更新后,利用 工具-部署-远程主机,可将当前已变更文件复制上传到指定文件目录,方便更新覆盖。
### 参与贡献
1. 方孟(fm453) 1. 方孟(fm453)
+1
View File
@@ -155,4 +155,5 @@ return [
99=>[0,-1], 99=>[0,-1],
], //费用单支付状态在财审时的前置状态要求 ], //费用单支付状态在财审时的前置状态要求
'H5Links'=>'//h5.ctms.hiluker.com/', //前端H5链接 'H5Links'=>'//h5.ctms.hiluker.com/', //前端H5链接
'mainDomain'=>'//dacms.hiluker.cn', //主域名
]; ];
@@ -37,6 +37,8 @@ class IndexController extends Common
{ {
$apis = [ $apis = [
'h5data'=>'拉取APP首页数据', 'h5data'=>'拉取APP首页数据',
'ads-splash'=>'开屏广告',
'ads-banner'=>'首页BANNER广告'
]; ];
$this->result('您正使用CMTS系统接口!', $apis, 200); $this->result('您正使用CMTS系统接口!', $apis, 200);
} }
@@ -21,7 +21,7 @@
$apis = [ $apis = [
'list'=>'城市列表', 'list'=>'城市列表',
]; ];
$this->result('您正使用CMTS-GM系统车主管理接口!', $apis, 200); $this->result('您正使用CMTS-GM系统城市管理接口!', $apis, 200);
} }
public function actionList() public function actionList()
+33 -3
View File
@@ -37,10 +37,40 @@
{ {
$apis = [ $apis = [
'h5data' => '拉取APP首页数据', 'h5data' => '拉取APP首页数据',
'ads-splash' => '开屏广告',
'ads-banner' => '首页BANNER广告'
]; ];
$this->result('您正使用CMTS-GM系统接口!', $apis, 200); $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() public function actionH5data()
{ {
$pid = $this->pid; $pid = $this->pid;
@@ -137,9 +167,9 @@
$return['msg'] = '首页数据下载!'; $return['msg'] = '首页数据下载!';
$return['data'] = [ $return['data'] = [
'orderToday' => $order_today_count, 'orderToday' => $order_today_count,
'orderTodayCreate'=>$order_today_create, 'orderTodayCreate' => $order_today_create,
'orderYesterday'=>$order_yesterday_count, 'orderYesterday' => $order_yesterday_count,
'orderYesterdayCreate'=>$order_yesterday_create, 'orderYesterdayCreate' => $order_yesterday_create,
'orderMonth' => $order_month_count, 'orderMonth' => $order_month_count,
'orderTotal' => $order_all_count, 'orderTotal' => $order_all_count,
'jiaocheToday' => $jiaoche_today_count, 'jiaocheToday' => $jiaoche_today_count,
@@ -31,6 +31,7 @@
class JiaocheController extends Common class JiaocheController extends Common
{ {
private $addtionWhere;
public function beforeAction($action) public function beforeAction($action)
{ {
if (!$this->pid) { if (!$this->pid) {
@@ -36,10 +36,13 @@ class NewsController extends Common
if (!$res) { if (!$res) {
$this->result('没有查询到相应的数据!', [], 0); $this->result('没有查询到相应的数据!', [], 0);
} }
$news = [];
foreach ($res as $v) {
$news[] = $v->toArray();
}
$data= [ $data= [
'total'=>intval($s['query']->count()), 'total'=>intval($s['query']->count()),
'news' => $res, 'news' => $news,
'page'=>$this->page 'page'=>$this->page
]; ];
$this->result('文章查询成功!', $data, 200); $this->result('文章查询成功!', $data, 200);
@@ -5,7 +5,7 @@ use addons\models\AcNewsCat;
use Yii; use Yii;
use yii\data\Pagination; use yii\data\Pagination;
class NewsCatController extends Common class NewscatController extends Common
{ {
public function beforeAction($action) public function beforeAction($action)
{ {
@@ -37,10 +37,13 @@ class NewsCatController extends Common
if (!$res) { if (!$res) {
$this->result('没有查询到相应的数据!', [], 0); $this->result('没有查询到相应的数据!', [], 0);
} }
$cats = [];
foreach ($res as $v) {
$cats[$v->id] = $v->toArray();
}
$data= [ $data= [
'total'=>intval($s['query']->count()), 'total'=>intval($s['query']->count()),
'cats' => $res, 'cats' => $cats,
'page'=>$this->page 'page'=>$this->page
]; ];
$this->result('文章分类查询成功!', $data, 200); $this->result('文章分类查询成功!', $data, 200);
+32 -10
View File
@@ -36,10 +36,10 @@ class NoticeController extends Common
if (!$res) { if (!$res) {
$this->result('没有查询到相应的数据!', [], 0); $this->result('没有查询到相应的数据!', [], 0);
} }
$notices = $this->formatList($res);
$data= [ $data= [
'total'=>intval($s['query']->count()), 'total'=>intval($s['query']->count()),
'news' => $res, 'notices' => $notices,
'page'=>$this->page 'page'=>$this->page
]; ];
$this->result('通知查询成功!', $data, 200); $this->result('通知查询成功!', $data, 200);
@@ -58,7 +58,7 @@ class NoticeController extends Common
if($sn) $res->sn = $sn; if($sn) $res->sn = $sn;
$res->save(); $res->save();
} }
$this->result('文章信息查询完成', $res->toArray(), 200); $this->result('通知信息查询完成', $res->toArray(), 200);
} }
public function actionAdd() public function actionAdd()
@@ -133,20 +133,20 @@ class NoticeController extends Common
$detail->is_show = 0; $detail->is_show = 0;
$res = $detail->save(); $res = $detail->save();
if ($res) { if ($res) {
$msg = '文章隐藏标记成功'; $msg = '通知隐藏标记成功';
$errorCode = 200; $errorCode = 200;
} else { } else {
$msg = '文章隐藏标记失败'; $msg = '通知隐藏标记失败';
} }
break; break;
case 'show': case 'show':
$detail->is_show = 1; $detail->is_show = 1;
$res = $detail->save(); $res = $detail->save();
if ($res) { if ($res) {
$msg = '文章显示标记成功'; $msg = '通知显示标记成功';
$errorCode = 200; $errorCode = 200;
} else { } else {
$msg = '文章显示标记失败'; $msg = '通知显示标记失败';
} }
break; break;
default: default:
@@ -176,9 +176,11 @@ class NoticeController extends Common
$data = $data->andwhere($where2); $data = $data->andwhere($where2);
} }
$pages = new Pagination(['totalCount' => $data->count(), 'pageSize' => $this->pageSize]); $pages = new Pagination(['totalCount' => $data->count(), 'pageSize' => $this->pageSize]);
$res = $data->offset($pages->offset)->limit($pages->limit)->orderBy('order_by DESC')->all(); $query = $data->offset($pages->offset)->limit($pages->limit);
//->orderBy('order_by DESC')
return ['res'=>$res,'query'=>$data]; $res = $query->all();
$arr = $query->asArray()->all();
return ['res'=>$res,'query'=>$data,'arr'=>$arr];
} }
/* /*
@@ -266,4 +268,24 @@ class NoticeController extends Common
return $data; 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']; $search['is_commission'] = (int)$search['is_commission'];
$where[] = ['=', 'is_commission', $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'] ?? ''); $search['is_cwqr'] = $search['is_cwqr'] ?? ($get['is_cwqr'] ?? '');
if ($search['is_cwqr'] != '') { if ($search['is_cwqr'] != '') {
@@ -1113,6 +1122,7 @@
{ {
$detail = $order->toArray(); $detail = $order->toArray();
if($detail['from_mid']){
$model = new Fans(); $model = new Fans();
$fans = $model->findOne($detail['from_mid']); $fans = $model->findOne($detail['from_mid']);
$user = $fans->toArray(); $user = $fans->toArray();
@@ -1123,6 +1133,7 @@
$user[$ext['key']] = $ext['value']; $user[$ext['key']] = $ext['value'];
} }
$detail['_user'] = $user; $detail['_user'] = $user;
}
if ($detail['store_id']) { if ($detail['store_id']) {
$model = new AcStore(); $model = new AcStore();
@@ -1180,7 +1191,7 @@
$detail['sn'] = $detail['sn'] ? $detail['sn'] : $sn; $detail['sn'] = $detail['sn'] ? $detail['sn'] : $sn;
$weekdays = [0 => '日', 1 => '一', 2 => '二', 3 => '三', 4 => '四', 5 => '五', 6 => '六']; $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['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['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']] : ''; $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'; $detail[$k] = $detail[$k] ? $detail[$k] : '/pics/nopic.jpg';
$url_pre = substr($detail[$k], 0, 4); $url_pre = substr($detail[$k], 0, 4);
if ($url_pre == '/pic') { 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') { } else if ($url_pre == 'http') {
$detail[$k . '_url'] = $detail[$k]; $detail[$k . '_url'] = $detail[$k];
} }
@@ -37,10 +37,14 @@
$res = $s['res']; $res = $s['res'];
if (!$res) { if (!$res) {
$this->result('没有查询到相应的数据!', [], 0); $this->result('没有查询到相应的数据!', [], 0);
}
$stores = [];
foreach ($res as $v) {
$stores[] = $v->toArray();
} }
$data= [ $data= [
'total'=>$s['query']->count(), 'total'=>$s['query']->count(),
'stores' => $res, 'stores' => $stores,
'page'=>$this->page 'page'=>$this->page
]; ];
$this->result('网点列表查询成功!', $data, 200); $this->result('网点列表查询成功!', $data, 200);
@@ -180,6 +184,7 @@
$pages = new Pagination(['totalCount' => $data->count(), 'pageSize' => $this->pageSize]); $pages = new Pagination(['totalCount' => $data->count(), 'pageSize' => $this->pageSize]);
$_orderby = 'order_by DESC'; $_orderby = 'order_by DESC';
$res = $data->offset($pages->offset)->limit($pages->limit)->orderBy($_orderby)->all(); $res = $data->offset($pages->offset)->limit($pages->limit)->orderBy($_orderby)->all();
return ['res'=>$res,'query'=>$data]; return ['res'=>$res,'query'=>$data];
} }
@@ -42,10 +42,14 @@
if (!$res) { if (!$res) {
$this->result('没有查询到相应的数据!', [], 0); $this->result('没有查询到相应的数据!', [], 0);
} }
$weituoren = [];
foreach ($res as $key=>$val) {
$weituoren[$key] = $val->toArray();
}
$data= [ $data= [
'total'=>$s['query']->count(), 'total'=>$s['query']->count(),
'weituoren' => $res, 'weituoren' => $weituoren,
'page'=>$this->page 'page'=>$this->page
]; ];
$this->result('合作单位查询成功!', $data, 200); $this->result('合作单位查询成功!', $data, 200);