init: import production code mss.nahaichuan.com (exclude Runtime/Uploads/backups/logs)
这个提交包含在:
@@ -0,0 +1,75 @@
|
||||
<?php
|
||||
|
||||
namespace Common\Model;
|
||||
|
||||
use Think\Model\ViewModel;
|
||||
|
||||
//[1.4.70]
|
||||
class RechargeViewModel extends ViewModel
|
||||
{
|
||||
public $viewFields = array(
|
||||
'RetailPayOrder' => array(
|
||||
'_table' => 'ls_retail_pay_order',
|
||||
'id','order_type','pay_type','trade_amount','out_trade_no','order_state',
|
||||
),
|
||||
'RetailRechargeOrder' => array(
|
||||
'_table' => 'ls_recharge_order',
|
||||
'id'=>'r_id','vid','status','money','all_money','store_id','add_time','merchant_id','cashier_id','user_type','vip_recharge_id','scene_type','type','give_money','repay_name',
|
||||
'_on' => 'RetailPayOrder.id = RetailRechargeOrder.pay_order_id'
|
||||
),
|
||||
'RetailVip' => array(
|
||||
'_table' => 'ls_retail_vip',
|
||||
'mobile_phone','balance','name','nickname','integral','card_key',
|
||||
'_on' => 'RetailRechargeOrder.vid = RetailVip.id'
|
||||
),
|
||||
);
|
||||
|
||||
/**
|
||||
* 查询单条数据(find)
|
||||
* @param array $map 条件
|
||||
* @param string $field 字段 '*'
|
||||
* @return array|bool $find|false
|
||||
*/
|
||||
public function getFind($map,$field = '*')
|
||||
{
|
||||
if(!$map){
|
||||
return false;
|
||||
}
|
||||
$find = $this->field($field)->where($map)->find();
|
||||
return $find;
|
||||
}
|
||||
|
||||
/**
|
||||
* 多条查询(select)
|
||||
* @param [array] $map 条件
|
||||
* @param [int] $page 分页
|
||||
* @param [int] $limit 数量
|
||||
* @return [array|bool] $res|false
|
||||
*/
|
||||
public function getSelect($map,$page = '',$limit = '')
|
||||
{
|
||||
if(!$map){
|
||||
return false;
|
||||
}
|
||||
if(!$page || !$limit){
|
||||
$select = $this->where($map)->select();
|
||||
}else{
|
||||
$select = $this->where($map)->page($page,$limit)->select();
|
||||
}
|
||||
return $select;
|
||||
}
|
||||
|
||||
/**
|
||||
* 统计数量(count)
|
||||
* @parma [array] $map 条件
|
||||
* @return [array|bool] $res|false
|
||||
*/
|
||||
public function total($map)
|
||||
{
|
||||
if(!$map){
|
||||
return false;
|
||||
}
|
||||
$total = $this->where($map)->count();
|
||||
return $total;
|
||||
}
|
||||
}
|
||||
在新工单中引用
屏蔽一个用户