ProductsCombind.php 737 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace app\cxinv\model;
  3. use think\model\concern\SoftDelete;
  4. class ProductsCombind extends Base
  5. {
  6. use SoftDelete;
  7. //设置字段信息
  8. protected $schema = [
  9. 'id' =>'bigint',//
  10. 'parent_id' =>'bigint',//组合商品id
  11. 'child_id' =>'bigint',//子商品id
  12. 'child_num' =>'int',//子商品每单位对应数量
  13. 'create_time' =>'datetime',//
  14. 'delete_time' =>'datetime',//
  15. ];
  16. protected $createTime = 'create_time';
  17. protected $updateTime = false;
  18. protected $deleteTime = 'delete_time';
  19. public function Products(){
  20. return $this->hasOne('FinancialProducts','id','child_id');
  21. }
  22. public static function CombindAddStock($pid,$num){
  23. }
  24. }