作者 654550265

Merge branch 'master' of http://114.215.101.231:8099/outsource/signUpForCar

# Conflicts:
#	public/themes/simpleboot3/user/yuyue/yu_studycar_2.html
... ... @@ -3,7 +3,7 @@
<component name="ChangeListManager">
<list default="true" id="03b59864-5835-4588-bfae-54004809f199" name="Default" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/user/controller/LoginController.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/user/controller/LoginController.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/app/admin/controller/CommentController.php" beforeDir="false" afterPath="$PROJECT_DIR$/app/admin/controller/CommentController.php" afterDir="false" />
</list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="TRACKING_ENABLED" value="true" />
... ... @@ -72,7 +72,7 @@
</provider>
</entry>
</file>
<file leaf-file-name="LoginController.php" pinned="false" current-in-tab="true">
<file leaf-file-name="LoginController.php" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/app/user/controller/LoginController.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="321">
... ... @@ -81,6 +81,15 @@
</provider>
</entry>
</file>
<file leaf-file-name="CommentController.php" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/app/admin/controller/CommentController.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="357">
<caret line="177" column="24" selection-start-line="177" selection-start-column="24" selection-end-line="177" selection-end-column="24" />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="UserBaseController.php" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/simplewind/cmf/controller/UserBaseController.php">
<provider selected="true" editor-type-id="text-editor">
... ... @@ -165,6 +174,7 @@
<option value="$PROJECT_DIR$/app/portal/controller/IndexController.php" />
<option value="$PROJECT_DIR$/simplewind/cmf/controller/UserBaseController.php" />
<option value="$PROJECT_DIR$/app/user/controller/LoginController.php" />
<option value="$PROJECT_DIR$/app/admin/controller/CommentController.php" />
</list>
</option>
</component>
... ... @@ -223,13 +233,13 @@
<item name="dm161xcgit" type="b2602c69:ProjectViewProjectNode" />
<item name="dm161xcgit" type="462c0819:PsiDirectoryNode" />
<item name="app" type="462c0819:PsiDirectoryNode" />
<item name="user" type="462c0819:PsiDirectoryNode" />
<item name="admin" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="dm161xcgit" type="b2602c69:ProjectViewProjectNode" />
<item name="dm161xcgit" type="462c0819:PsiDirectoryNode" />
<item name="app" type="462c0819:PsiDirectoryNode" />
<item name="user" type="462c0819:PsiDirectoryNode" />
<item name="admin" type="462c0819:PsiDirectoryNode" />
<item name="controller" type="462c0819:PsiDirectoryNode" />
</path>
<path>
... ... @@ -338,14 +348,7 @@
<workItem from="1535514127808" duration="727000" />
<workItem from="1535532970259" duration="2527000" />
<workItem from="1535546044129" duration="20814000" />
<workItem from="1535633001243" duration="13155000" />
</task>
<task id="LOCAL-00009" summary="已评价无数据情况">
<created>1535465324978</created>
<option name="number" value="00009" />
<option name="presentableId" value="LOCAL-00009" />
<option name="project" value="LOCAL" />
<updated>1535465324978</updated>
<workItem from="1535633001243" duration="13825000" />
</task>
<task id="LOCAL-00010" summary="已评价无数据情况">
<created>1535465766116</created>
... ... @@ -683,17 +686,24 @@
<option name="project" value="LOCAL" />
<updated>1535649911425</updated>
</task>
<option name="localTasksCounter" value="58" />
<task id="LOCAL-00058" summary="登录处理">
<created>1535650097321</created>
<option name="number" value="00058" />
<option name="presentableId" value="LOCAL-00058" />
<option name="project" value="LOCAL" />
<updated>1535650097321</updated>
</task>
<option name="localTasksCounter" value="59" />
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="67607000" />
<option name="totallyTimeSpent" value="68277000" />
</component>
<component name="ToolWindowManager">
<frame x="-8" y="-8" width="1936" height="1056" extended-state="6" />
<editor active="true" />
<layout>
<window_info content_ui="combo" id="Project" order="0" weight="0.14658849" />
<window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.14658849" />
<window_info anchor="bottom" id="TODO" order="6" />
<window_info anchor="bottom" id="Docker" order="7" show_stripe_button="false" />
<window_info anchor="bottom" id="Event Log" order="7" side_tool="true" />
... ... @@ -756,13 +766,6 @@
<option name="LAST_COMMIT_MESSAGE" value="登录处理" />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/api/user/route.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="105">
<caret line="15" column="5" selection-start-line="15" selection-start-column="5" selection-end-line="15" selection-end-column="22" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/api/user/controller/FavoritesController.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="126">
... ... @@ -1080,5 +1083,12 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/admin/controller/CommentController.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="357">
<caret line="177" column="24" selection-start-line="177" selection-start-column="24" selection-end-line="177" selection-end-column="24" />
</state>
</provider>
</entry>
</component>
</project>
\ No newline at end of file
... ...
... ... @@ -133,7 +133,7 @@ class CommentController extends AdminBaseController
if (!empty($mobile)) {
$where['mobile'] = $mobile;
}
$where['delete_time'] = 0;
$where['c.delete_time'] = 0;
$list = DB::name($this->table_name)
->alias('c')
->join('qnb_user u','u.id=c.teach_id')
... ... @@ -175,7 +175,7 @@ class CommentController extends AdminBaseController
->alias('c')
->join('qnb_user u','u.id=c.uid')
->field('c.*')
->where(['delete_time'=>0])
->where(['c.delete_time'=>0])
->paginate(15);
$this->assign("list", $list->items());
... ...
... ... @@ -146,7 +146,7 @@ class IndexController extends HomeBaseController
$gid = $req->param('gid');
$res = Db::name('goods')->where(['id' => $gid])->find();
$id = session('user.id');
$id = session('pay_uid');
$data['gid'] = $gid;
$data['uid'] = $id;
$data['create_time'] = time();
... ...
... ... @@ -95,6 +95,9 @@ class LoginController extends HomeBaseController
if (!$op_tel_info){
$op_info = Db::name('user')->where(['openid'=>session('openid')])->find();
if($op_info){
if($res['user_type'] == '2'){
$dataup['headimgurl'] = $op_info['headimgurl'];
}
$dataup['openid'] = session('openid');
$dataup['province'] = $op_info['province'];
$dataup['city'] = $op_info['city'];
... ...
... ... @@ -127,14 +127,12 @@ class YuyueController extends UserBaseController
} else {
$data['teach_id'] = intval($tech_id);
$data['uid'] = session('user.id');
$data['status'] = array('neq','3');
$w['uid'] = session('user.id');
$w['status'] = array('neq','3');
//预约订单完成后才可以再次预约
$rr = Db::name('yuyue')->where($data)->order('create_time', 'desc')->find();
unset($data['status']);
$ytime = strtotime($rr['yuyue_day'].''.$rr['yuyue_end'].':00');
$tt = time();
if ( $ytime >$tt) {
$rr = Db::name('yuyue')->where($w)->find();
if ( $rr) {
return json(['code' => '0', 'msg' => '您好,您有待学车预约']);
}
... ... @@ -144,9 +142,9 @@ class YuyueController extends UserBaseController
$data['yuyue_begin'] = session('yuyue_pre.begin');
$ress = Db::name('yuyue')->where($data)->find();
if($ress){
return json(['code'=>'0','msg'=>'抱歉,您已经预约过']);
}
// if($ress){
// return json(['code'=>'0','msg'=>'抱歉,您已经预约过']);
// }
$data['status'] = '1';
$data['create_time'] = time();
... ... @@ -281,12 +279,15 @@ class YuyueController extends UserBaseController
$data['yuyue_begin'] = $begin;
$data['yuyue_end'] = $end;
$data['yuyue_week'] = $week;
$data['status'] = array('neq','3');
$ress = Db::name('yuyue')->where($data)->find();
unset($data['status']);
if($ress){
return json(['code'=>'0','msg'=>'抱歉,您已经预约过']);
$w['uid'] = session('user.id');
$w['status'] = array('neq','3');
//预约订单完成后才可以再次预约
$rr = Db::name('yuyue')->where($w)->find();
if ( $rr) {
return json(['code' => '0', 'msg' => '您好,您有待学车预约']);
}
$data['status'] = 1;
$data['create_time'] = time();
... ...
... ... @@ -10,7 +10,7 @@
// [ 入口文件 ]
date_default_timezone_set('Asia/Shanghai');
// 调试模式开关
define("APP_DEBUG", 1);
define("APP_DEBUG", 0);
// 定义CMF根目录,可更改此目录
define('CMF_ROOT', __DIR__ . '/../');
... ...
<?php
/**
*
* example目录下为简单的支付样例,仅能用于搭建快速体验微信支付使用
* 样例的作用仅限于指导如何使用sdk,在安全上面仅做了简单处理, 复制使用样例代码时请慎重
* 请勿直接直接使用样例对外提供服务
*
**/
date_default_timezone_set('Asia/Shanghai');
require_once "../lib/WxPay.Api.php";
require_once "WxPay.JsApiPay.php";
require_once "WxPay.Config.php";
require_once 'log.php';
//初始化日志
$logHandler = new CLogFileHandler("../logs/" . date('Y-m-d') . '.log');
$log = Log::Init($logHandler, 15);
Log::DEBUG("===========step1-begin-jsapi-pay=============");
//①、获取用户openid
try {
$tools = new JsApiPay();
// $openId = $tools->GetOpenid();
$deta = $_REQUEST;
//测试专用 0.01
//$fee = $deta['fe'] ? $deta['fe'] * 100 : 100;
$fee = 1;
$out_trade_no = $deta['ot'] ? $deta['ot'] : date('YmdHis') . uniqid();
$body = $deta['sn'] ? $deta['sn'] : 'ceshi';
$attach = $deta['at'] ? $deta['at'] : 'ceshi';
$openId = $deta['op'] ? $deta['op'] : '';
//②、统一下单
$input = new WxPayUnifiedOrder();
$input->SetBody($body);
$input->SetAttach($attach);
$input->SetOut_trade_no($out_trade_no);
$input->SetTotal_fee($fee);
$input->SetTime_start(date("YmdHis"));
$input->SetTime_expire(date("YmdHis", time() + 600));
$input->SetGoods_tag("qnbug_tag");
// $input->SetNotify_url("http://dm161xueche.qnbug.cn/paycenter/wechat/notify.php");
$input->SetNotify_url("http://wx.youlj.cn/paycenter/wechat/notify.php");
$input->SetTrade_type("JSAPI");
$input->SetOpenid($openId);
$config = new WxPayConfig();
$order = WxPayApi::unifiedOrder($config, $input);
Log::DEBUG("===========step2-begin-jsapi-pay=============");
Log::DEBUG(json_encode($deta, true));
$jsApiParameters = $tools->GetJsApiParameters($order);
//获取共享收货地址js函数参数
$editAddress = $tools->GetEditAddressParameters();
} catch (Exception $e) {
Log::ERROR(json_encode($e));
}
//③、在支持成功回调通知中处理成功之后的事宜,见 notify.php
/**
* 注意:
* 1、当你的回调地址不可访问的时候,回调通知会失败,可以通过查询订单来确认支付是否成功
* 2、jsapi支付时需要填入用户openid,WxPay.JsApiPay.php中有获取openid流程 (文档可以参考微信公众平台“网页授权接口”,
* 参考http://mp.weixin.qq.com/wiki/17/c0f37d5704f0b64713d5d2c37b468d75.html)
*/
?>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>微信支付跳转中</title>
<script type="text/javascript">
//调用微信JS api 支付
function jsApiCall() {
WeixinJSBridge.invoke(
'getBrandWCPayRequest',
<?php echo $jsApiParameters; ?>,
function (res) {
WeixinJSBridge.log(res.err_msg);
//alert(res.err_code);
if (res.err_msg == 'get_brand_wcpay_request:ok') {
window.location.href = 'http://wx.youlj.cn/user/order/pay_success.html';
} else if (res.err_msg == 'get_brand_wcpay_request:cancel') {
window.history.go(-1);
}
}
);
}
function callpay() {
if (typeof WeixinJSBridge == "undefined") {
if (document.addEventListener) {
document.addEventListener('WeixinJSBridgeReady', jsApiCall, false);
} else if (document.attachEvent) {
document.attachEvent('WeixinJSBridgeReady', jsApiCall);
document.attachEvent('onWeixinJSBridgeReady', jsApiCall);
}
} else {
jsApiCall();
}
}
</script>
<script type="text/javascript">
//获取共享地址
function editAddress() {
WeixinJSBridge.invoke(
'editAddress',
<?php echo $editAddress; ?>,
function (res) {
var value1 = res.proviceFirstStageName;
var value2 = res.addressCitySecondStageName;
var value3 = res.addressCountiesThirdStageName;
var value4 = res.addressDetailInfo;
var tel = res.telNumber;
//alert(value1 + value2 + value3 + value4 + ":" + tel);
}
);
}
window.onload = function () {
if (typeof WeixinJSBridge == "undefined") {
if (document.addEventListener) {
document.addEventListener('WeixinJSBridgeReady', editAddress, false);
} else if (document.attachEvent) {
document.attachEvent('WeixinJSBridgeReady', editAddress);
document.attachEvent('onWeixinJSBridgeReady', editAddress);
}
} else {
editAddress();
}
};
callpay()
</script>
</head>
<body>
</body>
<?php
/**
*
* example目录下为简单的支付样例,仅能用于搭建快速体验微信支付使用
* 样例的作用仅限于指导如何使用sdk,在安全上面仅做了简单处理, 复制使用样例代码时请慎重
* 请勿直接直接使用样例对外提供服务
*
**/
date_default_timezone_set('Asia/Shanghai');
require_once "../lib/WxPay.Api.php";
require_once "WxPay.JsApiPay.php";
require_once "WxPay.Config.php";
require_once 'log.php';
//初始化日志
$logHandler = new CLogFileHandler("../logs/" . date('Y-m-d') . '.log');
$log = Log::Init($logHandler, 15);
Log::DEBUG("===========step1-begin-jsapi-pay=============");
//①、获取用户openid
try {
$tools = new JsApiPay();
// $openId = $tools->GetOpenid();
$deta = $_REQUEST;
//测试专用 0.01
$fee = $deta['fe'] ? $deta['fe'] * 100 : 100;
//$fee = 1;
$out_trade_no = $deta['ot'] ? $deta['ot'] : date('YmdHis') . uniqid();
$body = $deta['sn'] ? $deta['sn'] : 'ceshi';
$attach = $deta['at'] ? $deta['at'] : 'ceshi';
$openId = $deta['op'] ? $deta['op'] : '';
//②、统一下单
$input = new WxPayUnifiedOrder();
$input->SetBody($body);
$input->SetAttach($attach);
$input->SetOut_trade_no($out_trade_no);
$input->SetTotal_fee($fee);
$input->SetTime_start(date("YmdHis"));
$input->SetTime_expire(date("YmdHis", time() + 600));
$input->SetGoods_tag("qnbug_tag");
// $input->SetNotify_url("http://dm161xueche.qnbug.cn/paycenter/wechat/notify.php");
$input->SetNotify_url("http://wx.youlj.cn/paycenter/wechat/notify.php");
$input->SetTrade_type("JSAPI");
$input->SetOpenid($openId);
$config = new WxPayConfig();
$order = WxPayApi::unifiedOrder($config, $input);
Log::DEBUG("===========step2-begin-jsapi-pay=============");
Log::DEBUG(json_encode($deta, true));
$jsApiParameters = $tools->GetJsApiParameters($order);
//获取共享收货地址js函数参数
$editAddress = $tools->GetEditAddressParameters();
} catch (Exception $e) {
Log::ERROR(json_encode($e));
}
//③、在支持成功回调通知中处理成功之后的事宜,见 notify.php
/**
* 注意:
* 1、当你的回调地址不可访问的时候,回调通知会失败,可以通过查询订单来确认支付是否成功
* 2、jsapi支付时需要填入用户openid,WxPay.JsApiPay.php中有获取openid流程 (文档可以参考微信公众平台“网页授权接口”,
* 参考http://mp.weixin.qq.com/wiki/17/c0f37d5704f0b64713d5d2c37b468d75.html)
*/
?>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>微信支付跳转中</title>
<script type="text/javascript">
//调用微信JS api 支付
function jsApiCall() {
WeixinJSBridge.invoke(
'getBrandWCPayRequest',
<?php echo $jsApiParameters; ?>,
function (res) {
WeixinJSBridge.log(res.err_msg);
//alert(res.err_code);
if (res.err_msg == 'get_brand_wcpay_request:ok') {
window.location.href = 'http://wx.youlj.cn/portal/index/pay_success.html';
} else if (res.err_msg == 'get_brand_wcpay_request:cancel') {
window.history.go(-1);
}
}
);
}
function callpay() {
if (typeof WeixinJSBridge == "undefined") {
if (document.addEventListener) {
document.addEventListener('WeixinJSBridgeReady', jsApiCall, false);
} else if (document.attachEvent) {
document.attachEvent('WeixinJSBridgeReady', jsApiCall);
document.attachEvent('onWeixinJSBridgeReady', jsApiCall);
}
} else {
jsApiCall();
}
}
</script>
<script type="text/javascript">
//获取共享地址
function editAddress() {
WeixinJSBridge.invoke(
'editAddress',
<?php echo $editAddress; ?>,
function (res) {
var value1 = res.proviceFirstStageName;
var value2 = res.addressCitySecondStageName;
var value3 = res.addressCountiesThirdStageName;
var value4 = res.addressDetailInfo;
var tel = res.telNumber;
//alert(value1 + value2 + value3 + value4 + ":" + tel);
}
);
}
window.onload = function () {
if (typeof WeixinJSBridge == "undefined") {
if (document.addEventListener) {
document.addEventListener('WeixinJSBridgeReady', editAddress, false);
} else if (document.attachEvent) {
document.attachEvent('WeixinJSBridgeReady', editAddress);
document.attachEvent('onWeixinJSBridgeReady', editAddress);
}
} else {
editAddress();
}
};
callpay()
</script>
</head>
<body>
</body>
</html>
\ No newline at end of file
... ...
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta content="yes" name="apple-mobile-web-app-capable">
<meta content="yes" name="apple-touch-fullscreen">
<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,maximum-scale=1, minimum-scale=1, user-scalable=no">
<title>支付成功</title>
<link rel="stylesheet" href="/static/css/common.css">
<link rel="stylesheet" href="/static/css/style.css">
</head>
<body>
<div class="box ss">
<div class="success_img">
<img src="/static/image/pay_success.png">
</div>
<!--<h1 class="pay_money">¥7388.00</h1>-->
<div class="menu_two">
<a href="{:url('user/yuyue/index')}"><img src="/static/image/btn_study.png"/></a>
<a href="{:url('user/yuyue/my_order')}"><img src="/static/image/btn_look.png"/></a>
</div>
</div>
<script type="text/javascript" src="/static/js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="/static/js/common.js"></script>
</body>
</html>
\ No newline at end of file
... ...