ADD:添加后台文章、通知等管理端接口;
FIX:修正若干已知错误;
This commit is contained in:
@@ -89,7 +89,7 @@ class Common extends Controller
|
||||
|
||||
public function fansToken($user = [], $refresh = FALSE, $expire = NULL)
|
||||
{
|
||||
//生成token(用户数据,是否强制更新,过期时间 // TBD 具体方法有待优化
|
||||
//生成token(用户数据,是否强制更新,过期时间 // TBD 具体方法有待优化;Token应该入库,有核对流程
|
||||
$expire = $expire ? $expire : '+1 day';
|
||||
$token = Yii::$app->session->get('fansToken');
|
||||
$tokenExpired = Yii::$app->session->get('fansTokenExpired');
|
||||
|
||||
@@ -119,8 +119,8 @@ class FansController extends Common
|
||||
if (!$res) {
|
||||
$this->result('验证码校验失败');
|
||||
}
|
||||
if (($this->timetamp - $res->create_at) > 300) {
|
||||
// 超时5分钟
|
||||
if (($this->timestamp - $res->create_at) > 300) {
|
||||
//超时5分钟
|
||||
$this->result('验证码已失效,请重新获取');
|
||||
}
|
||||
|
||||
@@ -283,8 +283,8 @@ class FansController extends Common
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加一个新用户
|
||||
* @param $data 用户数据
|
||||
* 添加一个新用户 用户数据
|
||||
* @param $data
|
||||
* @return void
|
||||
*/
|
||||
private function fansAdd($data, $userModel)
|
||||
@@ -301,9 +301,9 @@ class FansController extends Common
|
||||
return $userModel;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $user 用户实例
|
||||
* @param $hasExt 有否扩展
|
||||
/** 用户实例、有否扩展
|
||||
* @param $user
|
||||
* @param $hasExt
|
||||
* @return void
|
||||
*/
|
||||
private function fansLogin($user, $hasExt = FALSE)
|
||||
|
||||
@@ -44,7 +44,7 @@ class IndexController extends Common
|
||||
public function actionAdsSplash()
|
||||
{
|
||||
$ads = [
|
||||
// "http://public.hiluker.com/ctms/client/app-kp/kp01.jpg",
|
||||
"http://public.hiluker.com/ctms/client/app-kp/kp01.jpg",
|
||||
"http://public.hiluker.com/ctms/client/app-kp/kp03.jpg",
|
||||
];
|
||||
$this->result('开屏广告!', $ads, 200);
|
||||
@@ -55,7 +55,7 @@ class IndexController extends Common
|
||||
$ads = [
|
||||
'0'=>[
|
||||
"image"=>'http://public.hiluker.com/ctms/client/app-banner/banner01.jpg',
|
||||
"link"=>'/pages/uni-starter/ucenter/ucenter'
|
||||
"link"=>'/pages/ctms/news/list/list'
|
||||
],
|
||||
'1'=>[
|
||||
"image"=>'http://public.hiluker.com/ctms/client/app-banner/banner03.jpg',
|
||||
@@ -96,18 +96,18 @@ class IndexController extends Common
|
||||
$_where[]=['=','is_turnover',0]; //排除交车单
|
||||
$_where[] = ['between','sign_date',$start,$end];
|
||||
$data = $model->find()->where($_where);
|
||||
$order_today_count = $data->count();
|
||||
$order_today_count = (int)$data->count();
|
||||
//今日交车
|
||||
$_where = $where;
|
||||
$_where[]=['=','is_turnover',1]; //交车单
|
||||
$_where[] = ['between','sign_date',$start,$end];
|
||||
$data = $model->find()->where($_where);
|
||||
$jiaoche_today_count = $data->count();
|
||||
$jiaoche_today_count = (int)$data->count();
|
||||
//今日录单
|
||||
$_where = $where;
|
||||
$_where[] = ['between','create_at',$start,$end];
|
||||
$data = $model->find()->where($_where);
|
||||
$order_today_create = $data->count();
|
||||
$order_today_create = (int)$data->count();
|
||||
|
||||
//昨日
|
||||
$_end = $start;
|
||||
@@ -118,18 +118,18 @@ class IndexController extends Common
|
||||
$_where[]=['=','is_turnover',0]; //排除交车单
|
||||
$_where[] = ['between','sign_date',$_start,$_end];
|
||||
$data = $model->find()->where($_where);
|
||||
$order_yesterday_count = $data->count();
|
||||
$order_yesterday_count = (int)$data->count();
|
||||
//昨日交车
|
||||
$_where = $where;
|
||||
$_where[]=['=','is_turnover',1]; //交车单
|
||||
$_where[] = ['between','sign_date',$_start,$_end];
|
||||
$data = $model->find()->where($_where);
|
||||
$jiaoche_yesterday_count = $data->count();
|
||||
$jiaoche_yesterday_count = (int)$data->count();
|
||||
//昨日录单
|
||||
$_where = $where;
|
||||
$_where[] = ['between','create_at',$_start,$_end];
|
||||
$data = $model->find()->where($_where);
|
||||
$order_yesterday_create = $data->count();
|
||||
$order_yesterday_create = (int)$data->count();
|
||||
|
||||
//本月起始时间点
|
||||
$_start = date('Y-m-01 00:00:00');
|
||||
@@ -142,38 +142,40 @@ class IndexController extends Common
|
||||
$_where[]=['=','is_turnover',0]; //排除交车单
|
||||
$_where[] = ['between','sign_date',$_start,$_end];
|
||||
$data = $model->find()->where($_where);
|
||||
$order_month_count = $data->count();
|
||||
$order_month_count = (int)$data->count();
|
||||
//本月交车
|
||||
$_where = $where;
|
||||
$_where[]=['=','is_turnover',1];
|
||||
$_where[] = ['between','sign_date',$_start,$_end];
|
||||
$data = $model->find()->where($_where);
|
||||
$jiaoche_month_count = $data->count();
|
||||
$jiaoche_month_count = (int)$data->count();
|
||||
|
||||
//累计运单
|
||||
$_where = $where;
|
||||
$_where[]=['=','is_turnover',0]; //排除交车单
|
||||
$data = $model->find()->where($_where);
|
||||
$order_all_count = $data->count();
|
||||
$order_all_count = (int)$data->count();
|
||||
//累计交车
|
||||
$_where = $where;
|
||||
$_where[]=['=','is_turnover',1];
|
||||
$data = $model->find()->where($_where);
|
||||
$jiaoche_all_count = $data->count();
|
||||
$jiaoche_all_count = (int)$data->count();
|
||||
|
||||
$return = [];
|
||||
$return['code'] = 200;
|
||||
$return['msg'] = '首页数据下载!';
|
||||
$return['data']= [
|
||||
'orderToday'=>$order_today_count,
|
||||
'orderYesterday'=>$order_yesterday_count,
|
||||
'orderMonth'=>$order_month_count,
|
||||
'orderTotal'=>$order_all_count,
|
||||
'jiaocheToday'=>$jiaoche_today_count,
|
||||
'jiaocheYesterday'=>$jiaoche_yesterday_count,
|
||||
'jiaocheMonth'=>$jiaoche_month_count,
|
||||
'jiaocheTotal'=>$jiaoche_all_count,
|
||||
'notice'=>0
|
||||
'orderToday'=>$order_today_count,
|
||||
'orderTodayCreate'=>$order_today_create,
|
||||
'orderYesterday'=>$order_yesterday_count,
|
||||
'orderYesterdayCreate'=>$order_yesterday_create,
|
||||
'orderMonth'=>$order_month_count,
|
||||
'orderTotal'=>$order_all_count,
|
||||
'jiaocheToday'=>$jiaoche_today_count,
|
||||
'jiaocheYesterday'=>$jiaoche_yesterday_count,
|
||||
'jiaocheMonth'=>$jiaoche_month_count,
|
||||
'jiaocheTotal'=>$jiaoche_all_count,
|
||||
'notice'=>0
|
||||
];
|
||||
exit(json_encode($return, JSON_UNESCAPED_UNICODE | JSON_FORCE_OBJECT));
|
||||
}
|
||||
|
||||
@@ -57,6 +57,7 @@ class NewsController extends Common
|
||||
}
|
||||
$model = new AcNews();
|
||||
$detail = $model->findOne($id);
|
||||
if(!$detail) $this->result('查询失败,未找到指定内容!');
|
||||
$s = $this->formatDetail($detail->toArray());
|
||||
$this->result('查询成功!', $s, 200);
|
||||
}
|
||||
@@ -188,7 +189,7 @@ class NewsController extends Common
|
||||
|
||||
// 'src="/upload/pics/'
|
||||
$upload_url = 'https://dacms.hiluker.cn';
|
||||
$s['content'] = str_replace('src="/upload/pics/', 'src="' . $upload_url . '/upload/pics/', $s['content']);
|
||||
$s['content'] = str_replace('src="/upload/pics/', 'src="' . $upload_url . '/upload-ctms/pics/', $s['content']);
|
||||
return $s;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,8 +52,10 @@ class OrderpreController extends Common
|
||||
$post = $this->postdata;
|
||||
$search = isset($post['search']) ? $post['search'] : [];
|
||||
//预置搜索条件,只允许查询与自己完全相关的订单
|
||||
if(!$this->user_id) $this->result('用户未登陆,拒绝查询!', [], 0);
|
||||
$where[] = ['=', 'from_uid', $this->user_id];
|
||||
$search['phone'] = $this->user_info->mobile;
|
||||
if(!$search['phone']) $this->result('没有用户手机号,查询失败!', [], 0);
|
||||
$where[] = ['=', 'from_mobile', $search['phone']];
|
||||
|
||||
if (isset($search['carno']) && !empty($search['carno'])) {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
namespace api\controllers\client\v1;
|
||||
|
||||
use Yii;
|
||||
use vendor\aliyun\dysms\Sms;
|
||||
use vendor\aliyun\dysms\Sms as DysmsClient;
|
||||
use common\models\CSms;
|
||||
use common\models\CVcode;
|
||||
use addons\models\AcPlat;
|
||||
@@ -21,7 +21,9 @@ class SmsController extends Common
|
||||
public function actionIndex()
|
||||
{
|
||||
$apis = [
|
||||
'vcode'=>'获取短信验证码'
|
||||
'vcode'=>'获取短信验证码',
|
||||
'send'=>'群发',
|
||||
'caiwu'=>'财务获取验证码'
|
||||
];
|
||||
$this->result('您正使用CMTS-CLIENT系统短信管理接口!', $apis, 200);
|
||||
}
|
||||
@@ -157,7 +159,7 @@ class SmsController extends Common
|
||||
$config['sign'] = isset($dataPost['sign']) ? $dataPost['sign'] : $params['aliDySms']['sign'];
|
||||
|
||||
$option = array();
|
||||
$sms = new Sms($option, $config);
|
||||
$sms = new DysmsClient($option, $config);
|
||||
$_time = time();
|
||||
$vcodeModel = new CVcode();
|
||||
//查询上次发送记录
|
||||
@@ -215,7 +217,7 @@ class SmsController extends Common
|
||||
break;
|
||||
}
|
||||
|
||||
// 发送前控制
|
||||
//发送前控制
|
||||
$host = yii::$app->request->hostName;
|
||||
$debug = $params['aliDySms']['debug'] ?? FALSE;
|
||||
$domains = $params['aliDySms']['domains'] ?? [];
|
||||
|
||||
Reference in New Issue
Block a user