12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- <?php
- namespace app\allwin\model;
- use think\Model;
- use think\facade\Validate;
- class StoreBill extends Model{
-
- protected $pk = 'id';
- protected $table = 'ai_allwin_store_bill';
- public function user(){
- return $this->hasOne('app\common\model\SystemUser','id','pay_uid');
- }
-
- public static function bill($where){
- return self::where($where)->order('id desc')->paginate(20,false,['query'=>['input' =>$where['user_id']]]);
- }
-
-
- public static function add(array $param,$message){
- $data['member_miniapp_id'] = intval($param['miniapp_id']);
- $data['store_id'] = intval($param['store_id']);
- $data['pay_uid'] = intval($param['pay_uid']);
- $data['money'] = floatval($param['money']);
- $data['message'] = $message;
- $data['update_time'] = time();
- return self::insert($data);
- }
- }
|