| 123456789101112131415161718192021222324252627282930313233 |
- <?php
- /**
- * 绿色积分明细
- */
- namespace app\common\model;
- use think\Model;
- class GreenScoreLogModel extends Model
- {
- protected $name = "green_score_log";
- /**
- * 记录
- * @param $param
- * @return array
- * @throws \think\db\exception\DbException
- */
- public function getLog ($param)
- {
- $type_conf = config('type.green_score');
- $list = self::where('uid', $param->uid)
- ->withAttr('type', function ($value, $data) use ($type_conf) {
- return isset($type_conf[$value]) ? $type_conf[$value] : '未知类型';
- })
- ->order('id', 'desc')
- ->paginate($param->data['limit'])
- ->toArray();
- return $list['data'];
- }
- }
|