| 123456789101112131415161718192021222324252627 |
- <?php
- namespace bizHd\stat\classes;
- use Yii;
- use bizHd\base\classes\BaseClass;
- class StatStudentMonthClass extends BaseClass
- {
- public static $baseFile = '\bizHd\stat\models\StatStudentMonth';
- //月订单数增加 ssh 2020.5.25
- public static function addStudent($shop, $month = null)
- {
- $sjId = $shop->sjId;
- $shopId = $shop->id;
- $month = isset($month) ? $month : date("Ym");
- $stat = self::getByCondition(['sjId' => $sjId, 'shopId' => $shopId, 'time' => $month], true);
- if (empty($stat)) {
- $stat = self::add(['sjId' => $sjId, 'shopId' => $shopId, 'time' => $month], true);
- }
- $stat->riseNum += 1;
- $stat->save();
- }
- }
|