Haloo! Selamat Datang di Komunitas Private Training Web Development (51328 Members, 542 Projects, 4039 Topic, 10793 Comments)

Butuh karyawan baru? atau seorang Web Developer (Part-time/Freelance/Full-time), cari disini : Members Area Jobs!

Error models Manggaleh - Unknown column 'b.ppn' in 'field list'

Dibuat
Login Terakhir 7 Bulan lalu,
Telah Dilihat 236 Kali
ismul fauzi Mengatakan : Premium -
Rate Topic :
  1. Assalamualaikum Warahmatullahi Wabarakatuh...
  2. selamat sore saya mau nanya cara mengatasi error,
  3.  
  4. Error Number: 1054
  5.  
  6. Unknown column 'b.ppn' in 'field list'
  7.  
  8. SELECT a.nama_pelanggan, a.alamat_pelanggan_1, a.kota, b.trx, c.total FROM (SELECT x.*, y.name as kota FROM mu_pelanggan x JOIN mu_city y ON x.city_id=y.city_id) as a LEFT JOIN (SELECT id_pelanggan, COUNT(*) trx FROM mu_transaksi GROUP BY id_pelanggan HAVING COUNT(id_pelanggan)) as b on a.id_pelanggan=b.id_pelanggan LEFT JOIN (SELECT a.*, b.id_pelanggan, sum(a.jumlah_jual*a.jumlah_satuan*a.harga_jual-a.diskon_jual-(b.ppn/100*(a.jumlah_jual*a.jumlah_satuan*a.harga_jual))) as total FROM `mu_transaksi_detail` a JOIN mu_transaksi b ON a.id_transaksi=b.id_transaksi GROUP BY b.id_pelanggan) as c on a.id_pelanggan=c.id_pelanggan WHERE b.trx >=1 ORDER BY b.trx DESC
  9.  
  10. Filename: models/Model_laporan.php
  11.  
  12. Line Number: 82
  13.  
  14.  
  15. gimana ya?_ Mohon bantuannya?

Ada 2 Jawaban

Bukhori Muslim 10 Bulan lalu  
Premium -
  1. Assalam,.. buka file "application/models/model_laporan.php"
  2. cari public function view_pelanggan_tersering() dan ubah semuanya menjadi seperti ini :
  3.  
  4. public function view_pelanggan_tersering(){
  5. return $this->db->query("select a.nama_pelanggan, a.alamat_pelanggan_1, a.kota, b.trx, c.total from
  6. (select x.*, y.name as kota from mu_pelanggan x JOIN mu_city y ON x.city_id=y.city_id) as a
  7. LEFT JOIN
  8. (select id_pelanggan, COUNT(*) trx from mu_transaksi GROUP BY id_pelanggan HAVING COUNT(id_pelanggan)) as b on a.id_pelanggan=b.id_pelanggan
  9. LEFT JOIN
  10. (SELECT a.*, b.id_pelanggan, sum(a.jumlah_jual*a.jumlah_satuan*a.harga_jual-a.diskon_jual) as total FROM `mu_transaksi_detail` a JOIN mu_transaksi b ON a.id_transaksi=b.id_transaksi GROUP BY b.id_pelanggan) as c on a.id_pelanggan=c.id_pelanggan where b.trx >=1 ORDER BY b.trx DESC");
  11. }
ismul fauzi 10 Bulan lalu  
Premium -
  1. Assalam,.. thanks gan,..Successfully
Maaf, Untuk Memberikan Komentar Anda Harus Login !!!