Manage.php 786 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace Scm_supplier\Lib;
  3. use Dever;
  4. class Manage
  5. {
  6. public function __construct()
  7. {
  8. Dever::load('manage/auth.init');
  9. }
  10. public function check($id, $name, $data)
  11. {
  12. $goods = Dever::param('goods', $data);
  13. list($goods_id, $sku_id) = explode('-', $goods);
  14. $where['goods_id'] = $goods_id;
  15. $where['sku_id'] = $sku_id;
  16. $where['supplier_id'] = Dever::input('update_supplier_id');
  17. $info = Dever::db('scm_supplier/goods')->getOne($where);
  18. if (!$info) {
  19. $supplier = Dever::db('scm_supplier/info')->one($where['supplier_id']);
  20. $goods_info = Dever::load('scm_product/lib/info')->getBaseInfo($goods_id, $sku_id);
  21. return Dever::alert($supplier['name'] . '无此商品:【' . $goods_info['aname'] . '】');
  22. }
  23. }
  24. }