| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- <?php
- namespace app\admin\model\user;
- use crmeb\traits\ModelTrait;
- use crmeb\basic\BaseModel;
- use think\facade\Db;
- /**
- * 用户消费新增金额明细 model
- * Class User
- * @package app\admin\model\user
- */
- class StoreBill extends BaseModel
- {
- /**
- * 数据表主键
- * @var string
- */
- protected $pk = 'id';
- /**
- * 模型名称
- * @var string
- */
- protected $name = 'store_bill';
- use ModelTrait;
- //修改积分减少积分记录
- public static function expend($title, $store_id, $type, $number, $link_id = 0, $balance = 0, $mark = '')
- {
- $pm = 0;
- $id = self::getkeytoid('bill_id');
- $add_time = date("Y-m-d H:i:s");
- return self::create(compact('title', 'store_id', 'link_id', 'type', 'number', 'balance', 'mark', 'pm', 'add_time', 'id'));
- }
- //修改积分增加积分记录
- public static function income($title, $store_id, $type, $number, $link_id = 0, $balance = 0, $mark = '')
- {
- $pm = 1;
- $id = self::getkeytoid('bill_id');
- $add_time = date("Y-m-d H:i:s");
- return self::create(compact('title', 'store_id', 'link_id', 'type', 'number', 'balance', 'mark', 'pm', 'add_time', 'id'));
- }
- }
|