xialei před 1 rokem
rodič
revize
f0e6e4cedf

+ 3 - 2
app/common/repositories/merchant/order/OrderMerchantRepository.php

@@ -1355,7 +1355,7 @@ class OrderMerchantRepository extends BaseRepository
1355 1355
                 "addtime"       =>time(),
1356 1356
                 "status"        =>-1,
1357 1357
                 "order_type"    =>$order_id,
1358
-                "order_id"      =>$order_sn,
1358
+                "order_id"      =>$order_id,
1359 1359
                 "mark"          =>"消费获得赠送红包",
1360 1360
                 "desc"          =>'',
1361 1361
                 "surplus"       =>$hongbao,
@@ -1373,7 +1373,7 @@ class OrderMerchantRepository extends BaseRepository
1373 1373
                 "addtime"       =>time(),
1374 1374
                 "status"        =>-1,
1375 1375
                 "order_type"    =>$order_id,
1376
-                "order_id"      =>$order_sn,
1376
+                "order_id"      =>$order_id,
1377 1377
                 "mark"          =>"消费获得赠送贡献值",
1378 1378
                 "desc"          =>'',
1379 1379
                 "surplus"       =>$pv,
@@ -1416,6 +1416,7 @@ class OrderMerchantRepository extends BaseRepository
1416 1416
             $gongxian_data = [
1417 1417
                 "uid"           =>$mer_data["uid"],
1418 1418
                 "mer_id"        =>$order["mer_id"],
1419
+                "pv"            =>$pv,
1419 1420
                 "number"  =>    $gongxian,
1420 1421
                 "addtime"       =>time(),
1421 1422
                 "status"        =>-1,

+ 50 - 0
app/controller/merchant/Common.php

@@ -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

+ 4 - 0
route/merchant.php

@@ -499,6 +499,10 @@ Route::group(config('admin.api_merchant_prefix') . '/', function () {
499 499
             Route::get('product', '/product')->name('merchantStatisticsProduct');
500 500
             Route::get('product_visit', '/productVisit')->name('merchantStatisticsProductVisit');
501 501
             Route::get('product_cart', '/productCart')->name('merchantStatisticsProductCart');
502
+
503
+            Route::get('zuorijinri', '/zuorijinri')->name('merchantCuorijinri');//今日昨日统计+总贡献值记录=总金豆记录
504
+            Route::get('zuixinjilu', '/zuixinjilu')->name('merchantZuixinjilu');//收银台最新记录接口
505
+            
502 506
         })->prefix('merchant.Common');
503 507
 
504 508
         //资金明细