12345678910111213141516171819202122232425262728293031323334353637 |
- <?php
- // +----------------------------------------------------------------------
- // | 萤火商城系统 [ 致力于通过产品和服务,帮助商家高效化开拓市场 ]
- // +----------------------------------------------------------------------
- // | Copyright (c) 2017~2021 https://www.yiovo.com All rights reserved.
- // +----------------------------------------------------------------------
- // | Licensed 这不是一个自由软件,不允许对程序代码以任何形式任何目的的再发行
- // +----------------------------------------------------------------------
- // | Author: 萤火科技 <admin@yiovo.com>
- // +----------------------------------------------------------------------
- declare (strict_types = 1);
- namespace app\api\model;
- use app\common\model\StoreDailySalesSt as StoreStModel;
- /**
- * 商城销售数据每日统计模型
- * Class ShopsDailySalesSt
- * @package app\common\model
- */
- class StoreDailySalesSt extends StoreStModel
- {
- public function addOne($tj,$dayMid){
- $now = time();
- $temp['sale_volume'] = $tj['sale_volume'];
- $temp['order_count'] = $tj['order_count'];
- //todo 其它统计数据待后续补充
- $temp['st_time'] = $dayMid;
- $temp['st_month'] = substr($dayMid,0,6);
- $temp['create_time'] = $now;
- $temp['update_time'] = $now;
- //批量插入,当门店过多时,需优化成分批插入
- self::where('st_time',$dayMid)->delete();
- self::insert($temp);
- }
- }
|