|
@@ -0,0 +1,55 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+namespace app\admin\controller;
|
|
|
+
|
|
|
+use think\facade\Db;
|
|
|
+use think\facade\Validate;
|
|
|
+
|
|
|
+class GoodOfflineLog extends Base
|
|
|
+{
|
|
|
+
|
|
|
+ //列表
|
|
|
+ public function getList()
|
|
|
+ {
|
|
|
+
|
|
|
+ $param = $this->request->only(['start_date' => '', 'end_date' => '', 'creater' => '', 'page' => 1, 'size' => 15], 'post', 'trim');
|
|
|
+
|
|
|
+ $where = [];
|
|
|
+ if ($param['start_date'] != '' && $param['end_date'] != '') $where[] = ['addtime', 'between', [$param['start_date'], $param['end_date']]];
|
|
|
+ if ($param['creater'] != '') $where[] = ['creater', 'like', '%' . $param['creater'] . '%'];
|
|
|
+
|
|
|
+ $count = Db::name('good_offline_log')->where($where)->count('id');
|
|
|
+
|
|
|
+ $list = Db::name('good_offline_log')
|
|
|
+ ->field('id,spuCode,good_name,creater,addtime')
|
|
|
+ ->where($where)
|
|
|
+ ->select()
|
|
|
+ ->toArray();
|
|
|
+
|
|
|
+ return app_show(0, "获取成功", ['list' => $list, 'count' => $count]);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ //详情
|
|
|
+ public function getDetail()
|
|
|
+ {
|
|
|
+
|
|
|
+ $id = $this->request->post('id', null, 'trim');
|
|
|
+
|
|
|
+ $val = Validate::rule(['id|ID' => 'require|number|gt:0']);
|
|
|
+
|
|
|
+ if (!$val->check(['id' => $id])) return error_show(1004, $val->getError());
|
|
|
+ else {
|
|
|
+ $res = Db::name('good_offline_log')
|
|
|
+ ->alias('gol')
|
|
|
+ ->field('gol.*,ri.result_desc')
|
|
|
+ ->where('gol.id', $id)
|
|
|
+ ->leftJoin('result_info ri', 'ri.result_code=gol.offline_reason')
|
|
|
+ ->find();
|
|
|
+
|
|
|
+ return app_show(0, "获取成功", $res);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+}
|