123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- <?php
- namespace app\cxinv\model;
- class ReportCode extends Base
- {
- //设置字段信息
- protected $schema = [
- 'id' =>'bigint',//
- 'qrdNo' =>'varchar',//销售单号
- 'cgdNo' =>'varchar',//采购单号
- 'companyNo' =>'varchar',//业务企业
- 'companyName' =>'varchar',//业务公司
- 'supplierName' =>'varchar',//
- 'supplierNo' =>'varchar',//供应商
- 'customerName' =>'varchar',//
- 'customerNo' =>'varchar',//客户企业
- 'seller' =>'varchar',//销售员
- 'seller_id' =>'int',//
- 'cgder' =>'varchar',//采购员
- 'cgder_id' =>'int',//
- 'payNo' =>'varchar',//采购单对账编号
- 'DzNo' =>'varchar',//采购付款申请编号
- 'hpNo' =>'varchar',//采购单回票申请编号
- 'invNo' =>'varchar',//销售单开票编号
- 'tradNo' =>'varchar',//销售单资金编号
- 'logNo' =>'varchar',//销售单资金认领编号
- 'returnInv' =>'varchar',//销售单退票申请编号
- 'returnTrad' =>'varchar',//销售单退款申请编号
- ];
- public function addField($filed,$vale){
- $arr= explode(',',$this->$filed);
- if(!in_array($vale,$arr)) $this->$filed == '' ? $this->$filed =$vale : $this->$filed .=','.$vale;
- }
- public function rmField($filed,$vale){
- $arr= explode(',',$this->$filed);
- if(is_array($vale)){
- foreach ($vale as $v){
- if(in_array($v,$arr)){
- $key = array_search($v,$arr);
- unset($arr[$key]);
- }
- }
- }else{
- if(in_array($vale,$arr)){
- $key = array_search($vale,$arr);
- unset($arr[$key]);
- }
- }
- $this->$filed=implode(',',$arr);
- }
- public function __destruct(){
- $this->save();
- }
- }
|