作者 刘朕
1 个管道 的构建 通过 耗费 0 秒

合并分支 '1iuzhen' 到 'master'

模型视图优化



查看合并请求 !251
... ... @@ -9,6 +9,7 @@
namespace app\admin\controller;
use app\admin\model\OrderModel;
use app\portal\model\OrderViewModel;
use cmf\controller\AdminBaseController;
use think\Db;
... ... @@ -140,7 +141,9 @@ class OrderController extends AdminBaseController
$where['create_time'] = ['<= time', $endTime];
}
}
$list = $this->singleData('order_view',$where,2,[],10);
$order_view_model = new OrderViewModel();
$list = $order_view_model->where($where)
->paginate(10);
$orderList = $list->items();
foreach ($orderList as $k=>$v) {
$v['options'] = json_decode($v['options'],true);
... ... @@ -219,7 +222,9 @@ class OrderController extends AdminBaseController
$where['create_time'] = ['<= time', $endTime];
}
}
$list = $this->singleData('order_view',$where,2,[],10);
$order_view_model = new OrderViewModel();
$list = $order_view_model->where($where)
->paginate(10);
$orderList = $list->items();
foreach ($orderList as $k=>$v) {
$v['options'] = json_decode($v['options'],true);
... ... @@ -304,7 +309,9 @@ class OrderController extends AdminBaseController
$where['create_time'] = ['<= time', $endTime];
}
}
$list = $this->singleData('order_view',$where,2,[],10);
$order_view_model = new OrderViewModel();
$list = $order_view_model->where($where)
->paginate(10);
$orderList = $list->items();
foreach ($orderList as $k=>$v) {
$v['options'] = json_decode($v['options'],true);
... ...
... ... @@ -10,6 +10,7 @@ namespace app\portal\controller;
use app\admin\model\OrderModel;
use app\admin\model\OrderSortModel;
use app\portal\model\OrderViewModel;
use cmf\controller\HomeBaseController;
use cmf\lib\Upload;
use think\Cache;
... ... @@ -274,7 +275,8 @@ class MemberSalesController extends HomeBaseController
'is_stop' => 0,
'delete_time' => 0
];
$orderList = Db::name('OrderView')
$order_view_model = new OrderViewModel();
$orderList = $order_view_model
->where(function ($q) use ($order_where1) {$q->where($order_where1);})
->whereOr(function ($q) use ($order_where2) {$q->where($order_where2);})
->select()->toArray();
... ...
<?php
/**
* Created by PhpStorm.
* User: 29925
* Date: 2018/11/21
* Time: 9:43
*/
namespace app\portal\model;
use think\Model;
class OrderViewModel extends Model
{
// 开启自动写入时间戳字段
protected $autoWriteTimestamp = true;
}
\ No newline at end of file
... ...
... ... @@ -1506,3 +1506,23 @@
'buyer_logon_id' => '186****5098',
'point_amount' => '0.00',
)
2018-11-15 08:23:45 {"trade_no":"","out_trade_no":"2018111552100565"}
2018-11-15 08:23:47 response: stdClass::__set_state(array(
'alipay_trade_query_response' =>
stdClass::__set_state(array(
'code' => '10000',
'msg' => 'Success',
'buyer_logon_id' => 'bie***@eyou.com',
'buyer_pay_amount' => '0.00',
'buyer_user_id' => '2088002229941027',
'invoice_amount' => '0.00',
'out_trade_no' => '2018111552100565',
'point_amount' => '0.00',
'receipt_amount' => '0.00',
'send_pay_date' => '2018-11-15 12:29:27',
'total_amount' => '4000.00',
'trade_no' => '2018111522001441021009470070',
'trade_status' => 'TRADE_SUCCESS',
)),
'sign' => 'q1EHSxY3l5PEDeR1fglLQNPU/k+M8AbyzNgEJIx63m/vm4+yAIo+mg6QSiF+czi9ufHxhrIbaokgJdvAgNQYc8w6PBr73OLLSpc3eBUuYzF5kywqbS9ORWYH4/QUABLMUsGK/a+Vkn6H1iSx9DH5/6MWRrDSt52Nm2+Mm4SAekNf1ZMYjcm9FvSuCk8lP1StLS7zfIoPoF78qI4c2skU8E/DaBdKIJRDgbNZUbn+xaQSbEnepMcjHnSgNFNqRZREWwrWVsISmOtyeCNkfG90jkNLUWCkqoKovn3ICjx58ONwExXrbVbtsELvSsLVsiWoeUd95GhhIg9pFeu+54m3bw==',
))
... ...