Commit 0b69f017 by 杨苏杭

card mac 修改为5字节

parent 00730ff9
......@@ -64,6 +64,7 @@ class Events
static::$redis->select('4');
\Lib\log\Log::bootLog();
......
......@@ -108,27 +108,27 @@ class OverController extends Controller
break;
case StateCode::FINISH_USER: //用户主动结束
$this->logRecord->setDesc('用户主动结束充电');
$this->logRecord->setDesc('用户主动结束充电->' . $state);
$orderState->toUserFinish();
break;
case StateCode::FINISH_SHED_TIMEOUT: //端口脱落超时
$this->logRecord->setDesc('端口脱落超时结束');
$this->logRecord->setDesc('端口脱落超时结束->' . $state);
$orderState->toShedTimeoutState();
break;
case StateCode::FINISH_REFUND: //充电失败退款
$this->logRecord->setDesc('充电失败退款结束');
$this->logRecord->setDesc('充电失败退款结束->' . $state);
$orderState->toRefundFinish();
break;
case StateCode::FINISH_EXCEED: //功率超限
$this->logRecord->setDesc('功率超限充电结束');
$this->logRecord->setDesc('功率超限充电结束->' . $state);
$orderState->toPowerExceedState();
break;
case StateCode::FINISH_FULL: //充满自停
$this->logRecord->setDesc('充满自停结束');
$this->logRecord->setDesc('充满自停结束->' . $state);
$orderState->toPowerFullState();
break;
case StateCode::FINISH_TIME_END: //充电时间结束
$this->logRecord->setDesc('充电时间完结束');
$this->logRecord->setDesc('充电时间完结束->' . $state);
$orderState->toTimeoutState();
break;
......@@ -164,6 +164,8 @@ class OverController extends Controller
}
} else {
Log::error('redis can not find');
$this->logRecord->setException(0);
$this->logRecord->setDesc('redis副本订单状态异常,非可结束订单状态');
......
......@@ -176,7 +176,7 @@ class PowerController extends Controller
if ($i === ($count - 1)) {
$orderModel = new OrderModel();
$capacity = hexdec($capacitys[$i]);
$orderModel->update(['start_capacity' => hexdec($capacitys[0])], 'id =' . $orderId . 'and start_capacity = -1');
$orderModel->update(['start_capacity' => hexdec($capacitys[0])], 'id =' . $orderId . ' and start_capacity = -1');
$orderModel->update([
'end_capacity' => $capacity,
], 'id = ' . $orderId);
......
......@@ -12,6 +12,7 @@ namespace Application\controller\card;
use Application\controller\Controller;
use Application\model\CardModel;
use Application\model\UserModel;
use Lib\log\Log;
class BalanceController extends Controller
{
......@@ -19,7 +20,7 @@ class BalanceController extends Controller
'32' => [
'card_id' => 4
'card_id' => 5,
]
];
......@@ -33,11 +34,16 @@ class BalanceController extends Controller
$cardModel = new CardModel();
$userId = $cardModel->getColumn('user_id', 'card_number = ' . $cardId);
Log::debug($cardId);
$userId = $cardModel->getColumn('user_id', 'mac = ' . "'$cardId'");
Log::debug($userId);
if (isset($userId)) {
$userModel = new UserModel();
$balance = $userModel->getColumn('balance', 'id = ' . $userId);
$balance = $userModel->getColumn('wallet_balance', 'id = ' . $userId);
}
$balance = isset($balance) ? $balance : 0;
......
......@@ -25,7 +25,7 @@ class RequestController extends Controller
'33' => [
'type' => 1,
'logic_id' => 1,
'card_id' => 4,
'card_id' => 5,
'time' => 2,
'price' => 2,
],
......@@ -62,11 +62,13 @@ class RequestController extends Controller
$cardModel = new CardModel();
$userId = $cardModel->getColumn('user_id', 'card_number = ' . $cardId);
$userId = $cardModel->getColumn('user_id', 'mac = ' . "'$cardId'");
Log::debug($userId);
if (isset($userId)) {
$userModel = new UserModel();
$balance = $userModel->getColumn('balance', 'id = ' . $userId);
$balance = $userModel->getColumn('wallet_balance', 'id = ' . $userId);
}
$balance = isset($balance) ? $balance : 0;
if ((int)$balance < (int)$price) {
......
......@@ -35,7 +35,7 @@ class Gateway
*
* @var string
*/
public static $registerAddress = 'webapppush.default:1239';
public static $registerAddress = '100.124.0.5:1239';
//public static $registerAddress = '127.0.0.1:1236';
......
......@@ -16,7 +16,7 @@ class StartMessage extends Message
/**
* @var string
*/
private $first = '充电已经开始,请注意接收消息';
private $first = '您的爱车已开始充电,预计在%s结束喔';
/**
* @var string
......@@ -38,6 +38,8 @@ class StartMessage extends Message
*/
private $remark = '感谢您的使用';
private $purchaseTime = 0;
/**
* StartMessage constructor.
*/
......@@ -74,7 +76,7 @@ class StartMessage extends Message
'color' => '#333',
],
'keyword3' => [
'value' => number_format($this->amount / 100, 2),
'value' => '¥' . number_format($this->amount / 100, 2),
'color' => '#333',
],
'remark' => [
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment