Commit d8e1223d authored by ZhuChunYang's avatar ZhuChunYang

update

parent 22beee32
......@@ -25,4 +25,27 @@ class AppController extends BaseController
$data['version_code']=(integer)$data['version_code'];
return $data;
}
public function actionNewUpdate()
{
$type = \Yii::$app->request->post('type', 1);
$data = AppVersion::getLastStable($type);
if ($data) {
$logItems = json_decode($data['log']);
$logstr = '';
foreach($logItems as $item){
if($logstr){
$logstr .="\n".$item;
}else{
$logstr = $item;
}
}
$data['log'] = $logstr;
}
$data['id']=(integer)$data['id'];
$data['status']=(integer)$data['status'];
$data['version_code']=(integer)$data['version_code'];
return $data;
}
}
\ No newline at end of file
<?php
/**
* Created by PhpStorm.
* User: ZCY
* Date: 2018/11/14
* Time: 18:53
*/
namespace api\controllers;
use api\base\BaseController;
use Yii;
class TradeController extends BaseController
{
/**
* 添加本地备注
*/
public function actionAddMemo()
{
$request = Yii::$app->request;
$hash = $request->post('hash');
$memo = $request->post('memo');
if($hash && $memo){
Yii::$app->redis_app->hset('trade_hash_memo',$hash,$memo);
return ['code' => 0,'data' => [], 'msg' => '本地备注添加成功'];
}else{
return ['code' => 1,'data' => [],'msg' => '交易hash值或者本地备注不能为空'];
}
}
/**
* 查看本地备注
*/
public function actionGetMemo()
{
$request = Yii::$app->request;
$hash = $request->post('hash');
if($hash){
$memo = Yii::$app->redis_app->hget('trade_hash_memo',$hash);
return ['code' => 0,'data' => $memo];
}else{
return ['code' => 1,'data' => [],'msg' => '交易hash值不能为空'];
}
}
}
\ No newline at end of file
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