| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <?php
- namespace app\common\model;
- use app\api\services\UserServices;
- use app\common\model\TimeModel;
- //use app\model\RedPoolModel;
- //use app\model\RedStorePoolModel;
- use app\common\model\UserDataModel;
- use think\Exception;
- use think\facade\Db;
- use think\Model;
- class PaymentModel extends Model
- {
- protected $name = "payment";
- /**
- * 消费记录
- * @param $param
- * @return array
- * @throws \think\db\exception\DbException
- */
- public function getLog ($param, $type = 0)
- {
- $where = [];
- $where[] = ['order_type', '=', 4];
- $where[] = ['state', '=', 6];
- $list = self::where('uid', $param->uid)
- ->where($where)
- ->withAttr('creat_at', function ($val, $data){
- return sr_getcurtime(strtotime($val), 'Y-m-d');
- })
- ->order('id', 'desc')
- ->field('id,total_fee,creat_at')
- ->paginate($param->data['limit'])
- ->toArray();
- foreach ($list['data'] as $key=>&$val){
- $val['type'] = '购买商品';
- }
- return $list['data'];
- }
- }
|