init: import production code mss.nahaichuan.com (exclude Runtime/Uploads/backups/logs)
这个提交包含在:
@@ -0,0 +1,134 @@
|
||||
<?php
|
||||
|
||||
namespace Common\Model;
|
||||
|
||||
use Think\Model;
|
||||
//[1.1.92]
|
||||
class GuideIncomeModel extends Model
|
||||
{
|
||||
protected $tableName = 'retail_guideincome';
|
||||
protected $fields = array(
|
||||
'id', //int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
'billid', //int(10) DEFAULT NULL COMMENT '消费记录表id',
|
||||
'vipid', //int(10) DEFAULT NULL COMMENT '会员id',
|
||||
'storeid', //int(10) DEFAULT NULL COMMENT '门店id',
|
||||
'guideid', //int(10) DEFAULT NULL COMMENT '导购员id',
|
||||
'allmoney', //decimal(10,2) DEFAULT NULL COMMENT '消费总金额',
|
||||
'moneystate', //tinyint(10) DEFAULT '1' COMMENT '提现状态:1.未提现2.提现中3.已提现',
|
||||
'guidetype', //tinyint(10) DEFAULT NULL COMMENT '导购员提现类型:1.支付宝2.微信3.银行卡',
|
||||
'auditname', //varchar(10) DEFAULT NULL COMMENT '审核人',
|
||||
'auditnotes', //varchar(255) DEFAULT NULL COMMENT '审核内容',
|
||||
'moneytime', //varchar(20) DEFAULT NULL COMMENT '提现时间',
|
||||
'commission', //int(10) DEFAULT NULL COMMENT '佣金比',
|
||||
'income', //decimal(10,2) DEFAULT NULL COMMENT '所得佣金',
|
||||
'paytype', //tinyint(10) DEFAULT NULL COMMENT '支付类型 1现金 2银行卡 3微信支付 4支付宝支付 5会员卡余额支付 6小程序商城微信支付 7其他支付方式 8组合支付',
|
||||
'paytime', //varchar(20) DEFAULT NULL COMMENT '支付时间',
|
||||
);
|
||||
|
||||
/**
|
||||
* 添加
|
||||
* @param $data
|
||||
* @return mixed
|
||||
*/
|
||||
public function addOrder($data)
|
||||
{
|
||||
$res = $this->add($data);
|
||||
return $res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
* @param $map
|
||||
* @param $save
|
||||
* @return mixed
|
||||
*/
|
||||
public function updateOrder($map, $save)
|
||||
{
|
||||
$res = $this->where($map)->save($save);
|
||||
return $res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取一条
|
||||
* @param $map
|
||||
* @param string $field
|
||||
* @return mixed
|
||||
*/
|
||||
public function getFind($map, $field = '*')
|
||||
{
|
||||
$res = $this->field($field)->where($map)->find();
|
||||
return $res;
|
||||
}
|
||||
/**
|
||||
* 获取某字段
|
||||
* @param $map
|
||||
* @param string $fields
|
||||
* @param $bol
|
||||
* @return mixed
|
||||
*/
|
||||
public function getFindField($map, $fields = 'id', $bol = false)
|
||||
{
|
||||
$map['state'] = 0;
|
||||
$res = $this->where($map)->getField($fields, $bol);
|
||||
return $res;
|
||||
}
|
||||
/**
|
||||
* @param $map
|
||||
* @param string $field
|
||||
* @param string $order
|
||||
* @param string $page
|
||||
* @return mixed
|
||||
*/
|
||||
public function getSelect($map, $field = '*', $order = 'id asc', $page = '')
|
||||
{
|
||||
if ($page) {
|
||||
$res = $this->field($field)->where($map)->order($order)->page($page)->select();
|
||||
} else {
|
||||
$res = $this->field($field)->where($map)->order($order)->select();
|
||||
}
|
||||
return $res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取数量
|
||||
* @param $map
|
||||
* @return mixed
|
||||
*/
|
||||
public function getCount($map)
|
||||
{
|
||||
$res = $this->where($map)->count();
|
||||
return $res;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 某个字段向上增加
|
||||
* @param $map 条件
|
||||
* @param $key 字段名
|
||||
* @param $val 增加的值
|
||||
* @return mixed
|
||||
*/
|
||||
public function toSetInc($map, $key, $val)
|
||||
{
|
||||
$res = $this->where($map)->setInc($key, $val);
|
||||
return $res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 某个字段向下加减少
|
||||
* @param $map 条件
|
||||
* @param $key 字段名
|
||||
* @param $val 减少的值
|
||||
* @return mixed
|
||||
*/
|
||||
public function toSetDec($map, $key, $val)
|
||||
{
|
||||
$res = $this->where($map)->setDec($key, $val);
|
||||
return $res;
|
||||
}
|
||||
|
||||
public function doDelete($map){
|
||||
$res = $this->where($map)->delete();
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
在新工单中引用
屏蔽一个用户