|
|
@@ -18,6 +18,7 @@ use app\common\repositories\store\order\StoreOrderRepository;
|
|
18
|
18
|
use app\common\repositories\store\product\ProductRepository;
|
|
19
|
19
|
use app\common\repositories\user\UserRelationRepository;
|
|
20
|
20
|
use app\common\repositories\user\UserVisitRepository;
|
|
|
21
|
+use think\facade\Db;
|
|
21
|
22
|
use think\App;
|
|
22
|
23
|
|
|
23
|
24
|
/**
|
|
|
@@ -41,8 +42,57 @@ class Common extends BaseController
|
|
41
|
42
|
{
|
|
42
|
43
|
parent::__construct($app);
|
|
43
|
44
|
$this->merId = $this->request->merId() ?: null;
|
|
|
45
|
+
|
|
|
46
|
+
|
|
44
|
47
|
}
|
|
45
|
48
|
|
|
|
49
|
+
|
|
|
50
|
+ /**今日昨日统计+总贡献值记录=总金豆记录
|
|
|
51
|
+ * @param null $merId
|
|
|
52
|
+ * @return mixed
|
|
|
53
|
+ * @author xaboy
|
|
|
54
|
+ * @day 2020/6/25
|
|
|
55
|
+ */
|
|
|
56
|
+ public function zuorijinri()
|
|
|
57
|
+ {
|
|
|
58
|
+ $merId = $this->merId;
|
|
|
59
|
+
|
|
|
60
|
+ $list['gongxian'] = Db::name('user_sign_gongxian')->where('mer_id', $merId)->value('number');
|
|
|
61
|
+ $list['jingdou'] = Db::name('user_sign_jingdou')->where('mer_id', $merId)->value('number');
|
|
|
62
|
+
|
|
|
63
|
+ return app('json')->success(compact('merId', 'list'));
|
|
|
64
|
+ }
|
|
|
65
|
+
|
|
|
66
|
+
|
|
|
67
|
+
|
|
|
68
|
+ /**收银台最新记录接口
|
|
|
69
|
+ * @param null $merId
|
|
|
70
|
+ * @return mixed
|
|
|
71
|
+ * @author xaboy
|
|
|
72
|
+ * @day 2020/6/25
|
|
|
73
|
+ */
|
|
|
74
|
+ public function zuixinjilu()
|
|
|
75
|
+ {
|
|
|
76
|
+ $merId = $this->merId;
|
|
|
77
|
+ $merId = 476;
|
|
|
78
|
+ $pageNum = $this->request->param('pageNum') ?: 1;
|
|
|
79
|
+ $pageSize = $this->request->param('pageSize') ?: 10;
|
|
|
80
|
+
|
|
|
81
|
+ $query = Db::name('order_merchant');
|
|
|
82
|
+ $count = $query->where('mer_id', $merId)->count();
|
|
|
83
|
+ $list = $query->page($pageNum, $pageSize)->order('id desc')->where('mer_id', $merId)->select();
|
|
|
84
|
+ $list = $list->toArray();
|
|
|
85
|
+ foreach ($list as $k => $v) {
|
|
|
86
|
+ $list[$k]['pv'] = Db::name('user_sign_gongxian')->where('mer_id', $v['mer_id'])->where('order_id', $v['id'])->value('pv') ?? 0;
|
|
|
87
|
+ $list[$k]['gongxian'] = Db::name('user_sign_gongxian')->where('mer_id', $v['mer_id'])->where('order_id', $v['id'])->value('number') ?? 0;
|
|
|
88
|
+ $list[$k]['jingdou'] = Db::name('user_sign_jingdou')->where('mer_id', $v['mer_id'])->where('order_id', $v['id'])->value('number') ?? 0;
|
|
|
89
|
+ }
|
|
|
90
|
+
|
|
|
91
|
+ return app('json')->success(compact('merId', 'list', 'count'));
|
|
|
92
|
+ }
|
|
|
93
|
+
|
|
|
94
|
+
|
|
|
95
|
+
|
|
46
|
96
|
/**
|
|
47
|
97
|
* @param null $merId
|
|
48
|
98
|
* @return mixed
|