...
|
...
|
@@ -3,6 +3,8 @@ |
|
|
namespace app\index\controller;
|
|
|
|
|
|
use app\common\controller\Frontend;
|
|
|
use app\common\model\TodayTimeLog;
|
|
|
use think\Db;
|
|
|
|
|
|
class Index extends Frontend
|
|
|
{
|
...
|
...
|
@@ -20,4 +22,21 @@ class Index extends Frontend |
|
|
{
|
|
|
return $this->view->fetch();
|
|
|
}
|
|
|
|
|
|
// 批量修改学习时长
|
|
|
public function changeread()
|
|
|
{
|
|
|
// $ids = [22,27,35,37,40,42,45,47,49,57,58,64,65,69,78,32,75,62,21,23,44,36,71,70,39];
|
|
|
// $unable = [-2147483647,2147483647,-2147483648,2147483648];
|
|
|
// $user_arr = [];
|
|
|
// foreach ($ids as $v) {
|
|
|
// $reading = TodayTimeLog::whereNotIn('reading',$unable)->where('user_id',$v)->sum('reading');
|
|
|
// $user_arr[] = [
|
|
|
// 'id' => $v,
|
|
|
// 'reading' => $reading
|
|
|
// ];
|
|
|
// }
|
|
|
// (new \app\common\model\User())->saveAll($user_arr);
|
|
|
// print_r($user_arr);exit;
|
|
|
}
|
|
|
} |
...
|
...
|
|