1054 Unknown column 'mjd.remaining' in 'field list'

  • Posts: 198
  • Thank you received: 7
7 years 3 months ago #275776

-- HikaShop version -- : 3.1.1
-- Joomla version -- : 3.7.4
-- PHP version -- : 7.0

I try to re-import Mijoshop so al the data is sync but i get this error:

1054 Unknown column 'mjd.remaining' in 'field list'

Please Log in or Create an account to join the conversation.

  • Posts: 26159
  • Thank you received: 4028
  • MODERATOR
7 years 3 months ago #275777

Hello,

Can you please indicate which Mijoshop version is installed in the website ?

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 198
  • Thank you received: 7
7 years 3 months ago #275795

Hi Jerome i'm using 3.2.1 (the latest version)

Please Log in or Create an account to join the conversation.

  • Posts: 82906
  • Thank you received: 13378
  • MODERATOR
7 years 3 months ago #275810

Hi,

Apparently something changed in the mijoshop_download table in your database since normally that column shouldn't be missing.
Could you check that table in your database via your phpmyadmin ? What do you have there ?

As a quick fix, you can remove the code:

$sql = 'INSERT IGNORE INTO `#__hikashop_download` (`'.implode('`,`',array_keys($data)).'`) '.
			'SELECT '.implode(',',$data).' FROM `#__mijoshop_download` AS mjd '.
			'INNER JOIN `#__mijoshop_download_description` mjdd ON mjd.download_id = mjdd.download_id '.
			'INNER JOIN `#__hikashop_file` AS hkf ON ( CONVERT(hkf.file_name USING utf8) = CONVERT(mjdd.name USING utf8) )'.
			'INNER JOIN `#__mijoshop_product_to_download` AS mjpd ON mjd.download_id = mjpd.download_id '.
			'INNER JOIN `#__mijoshop_order_product` AS mjop ON mjpd.product_id = mjop.product_id '.
			'INNER JOIN `#__hikashop_order` AS hko ON hko.order_mijo_id = mjop.order_id '.
			'WHERE mjd.download_id > '.$this->options->last_mijo_pfile;

		$this->db->setQuery($sql);
		$this->db->query();
		$total = $this->db->getAffectedRows();
from the file administrator/components/com_hikashop/helpers/import/mijo.php and that will remove the problem when you launch the import. That query is only to retrieve the number of downloads from orders in MijoShop so in most cases it's actually not needed at all.

Please Log in or Create an account to join the conversation.

  • Posts: 198
  • Thank you received: 7
7 years 3 months ago #275826

Hi Nicolas, the error is gone now.

Re-import seems to work correct now, only the order date is not correct an example: 2106-02-07 06:28.

Because we work with downloadable products this date may be important for us.

Regards

Please Log in or Create an account to join the conversation.

  • Posts: 26159
  • Thank you received: 4028
  • MODERATOR
7 years 3 months ago #275829

Hello,

In which field exactly the date is incorrect ?
I checked the code for the import of orders and it copy the value directly from Mijo ; so I assume that it is (or was) using timestamp like we do.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 198
  • Thank you received: 7
7 years 3 months ago #275854

Hi Jerome,

See screenshots from the same orders at first MijoShop and the second sho ti from HikaShop:

In HikaShop all the date's are the same....

Attachments:
Last edit: 7 years 3 months ago by renem.

Please Log in or Create an account to join the conversation.

  • Posts: 26159
  • Thank you received: 4028
  • MODERATOR
7 years 3 months ago #275856

Hello,

Sorry, I think that I was not clear enough.
What are the exact field names and what is the exact content that you can see in the database ?

Please understand that with your current screenshot we can't understand what is wrong except that we can see a date in a far future we can't even know if the rest of the date is good, or completely wrong. So please be extremely precise.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 198
  • Thank you received: 7
7 years 3 months ago #275981

Hi Jerome your'e absolutely right.

I made two screenshots from the same orders:



As you can see the date's are totally different after importing from Mijoshop.

Attachments:
Last edit: 7 years 3 months ago by renem.

Please Log in or Create an account to join the conversation.

  • Posts: 26159
  • Thank you received: 4028
  • MODERATOR
7 years 3 months ago #275983

Hello,

So it means that Mjioshop do not use anymore "timestamp" but switch to "date" fields.
And you cannot put a date into a timestamp, the result is (as you can see) chaotic.

In the Mijoshop import file, you will find these lines

'order_created' => 'mjo.date_added',
'order_modified' => 'mjo.date_modified',

And you need to replace them by
'order_created' => 'UNIX_TIMESTAMP(mjo.date_added)',
And
'order_modified' => 'UNIX_TIMESTAMP(mjo.date_modified)',

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 198
  • Thank you received: 7
7 years 3 months ago #276029

Hi Jerome,

Yes this did the trick! Awesome support!

Regards René

Last edit: 7 years 3 months ago by renem.

Please Log in or Create an account to join the conversation.

Time to create page: 0.090 seconds
Powered by Kunena Forum