维护用户销售统计——脚本
This commit is contained in:
@@ -5,7 +5,7 @@
|
|||||||
* @Author: kangkang
|
* @Author: kangkang
|
||||||
* @Date: 2020-10-16 14:44:02
|
* @Date: 2020-10-16 14:44:02
|
||||||
* @LastEditors: Please set LastEditors
|
* @LastEditors: Please set LastEditors
|
||||||
* @LastEditTime: 2020-11-25 13:10:11
|
* @LastEditTime: 2020-11-25 13:27:34
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace app\manager\model;
|
namespace app\manager\model;
|
||||||
@@ -227,6 +227,7 @@ class ProductOrder extends Model
|
|||||||
{
|
{
|
||||||
return $this->field('UserId,max(UpdateTime) as last_time')
|
return $this->field('UserId,max(UpdateTime) as last_time')
|
||||||
->where(['OrderState' => ['in', ProductOrderEnum::$PayComplete]])
|
->where(['OrderState' => ['in', ProductOrderEnum::$PayComplete]])
|
||||||
|
->group(['UserId'])
|
||||||
->fetchAll();
|
->fetchAll();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ $user_model->updateOne(['Id' => ['in', $cost_overtime_user_id_list]], ['follow_s
|
|||||||
$all_last_cost = $product_order_model->getUserCostTime();
|
$all_last_cost = $product_order_model->getUserCostTime();
|
||||||
$user_last_cost_id = [];
|
$user_last_cost_id = [];
|
||||||
$all_last_cost_list = [];
|
$all_last_cost_list = [];
|
||||||
foreach ($all_last_costas as $info) {
|
foreach ($all_last_cost as $info) {
|
||||||
$all_last_cost_list[$info['UserId']] = $info;
|
$all_last_cost_list[$info['UserId']] = $info;
|
||||||
$user_last_cost_id[] = $info['UserId'];
|
$user_last_cost_id[] = $info['UserId'];
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user