123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- <?php
- namespace app\cxinv\model;
- use app\user\model\TaxCategory;use think\model\concern\SoftDelete;
- class FinancialProducts extends Base
- {
- use SoftDelete;
- protected $schema = [
- 'id' =>'bigint',
- 'skuCode' =>'varchar',
- 'goodName' =>'varchar',
- 'inv_good_name' =>'varchar',
- 'seller_code' =>'varchar',
- 'seller_name' =>'varchar',
- 'buyer_code' =>'varchar',
- 'buyer_name' =>'varchar',
- 'good_type' =>'varchar',
- 'good_source' =>'tinyint',
- 'spec' =>'varchar',
- 'good_code' =>'varchar',
- 'unit' =>'varchar',
- 'unit_price' =>'decimal',
- 'subunit_price' =>'decimal',
- 'unit_weight' =>'decimal',
- 'spectral' =>'varchar',
- 'inv_type' =>'varchar',
- 'cat_code' =>'varchar',
- 'cat_name' =>'varchar',
- 'cat_tax' =>'varchar',
- 'status' =>'tinyint',
- 'basic_status' =>'tinyint',
- 'is_combind' =>'tinyint',
- 'apply_id' =>'int',
- 'apply_name' =>'varchar',
- 'create_time' =>'datetime',
- 'update_time' =>'datetime',
- 'delete_time' =>'datetime',
- ];
- protected $createTime = "create_time";
- protected $updateTime = "update_time";
- protected $deleteTime='delete_time';
- public function ProductsCombind(){
- return $this->hasMany('ProductsCombind','parent_id','id');
- }
- public function setCatNameAttr($value,$row){
- return TaxCategory::where("merge_code",$row['cat_code'])->value("short_name","");
- }
- }
|